Skip to content

feat(maven): Add maven target to deploy to Maven Central - #258

Merged
iker-barriocanal merged 111 commits into
masterfrom
iker/feat/maven-target
Jul 8, 2021
Merged

iker-barriocanal merged 111 commits into
masterfrom
iker/feat/maven-target

Conversation

@iker-barriocanal

@iker-barriocanal iker-barriocanal commented Jun 9, 2021 •

Copy link
Copy Markdown
Contributor

The goal of the new maven target is to automate the publishing of sentry-java (Android and Java) to Maven Central.

@iker-barriocanal iker-barriocanal self-assigned this Jun 9, 2021

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far!

We might have to adjust the maven upload command to be a little more configurable but I think that’s a non-issue right now

Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
@iker-barriocanal iker-barriocanal changed the title feat(maven): Add mavent target to deploy to Maven Central feat(maven): Add maven target to deploy to Maven Central Jun 10, 2021

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last set of comments, will then wait for undraft to finish review

Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/utils/mavenDeployment.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts
Comment on lines +179 to +183
// Maven central is very flaky, so retrying with an exponential delay in
// in case it fails.
await retrySpawnProcess(this.mavenConfig.gradleCliPath, [
'closeAndReleaseRepository',
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now a Gradle plugin does it (close and promote the releases): https://github.com/vanniktech/gradle-maven-publish-plugin/tree/master/src/main/kotlin/com/vanniktech/maven/publish/nexus

if we do those HTTP requests directly via Craft, we could remove the Gradle plugin for good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no support for the Gradle plugin yet, it will be supported at a later stage. This is targeting https://github.com/getsentry/sentry-java.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's not really related to our sentry android gradle plugin, but rather the graadle plugin that calls closeAndReleaseRepository.
if we replicate what that plugin does via craft, we can eliminate the usage of 3rd party plugins to release our things

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the maven cli does not have the ability to close the repo and promote the releases on sonatype, thats why we use this plugin, otherwise, we'd need to do it manually.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO, we can address this later.

@iker-barriocanal
iker-barriocanal requested a review from BYK July 7, 2021 09:41

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a todo somewhere about updating the Docker image to include the necessary binaries?

Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/__tests__/maven.test.ts Outdated
Comment thread src/targets/maven.ts
Comment thread src/targets/maven.ts
Comment thread src/utils/__tests__/async.test.ts
@iker-barriocanal
iker-barriocanal enabled auto-merge (squash) July 8, 2021 09:59

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment thread src/targets/__tests__/maven.test.ts
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
Comment thread src/targets/maven.ts Outdated
@iker-barriocanal
iker-barriocanal merged commit 6109727 into master Jul 8, 2021
@iker-barriocanal
iker-barriocanal deleted the iker/feat/maven-target branch July 8, 2021 12:30
iker-barriocanal added a commit that referenced this pull request Jul 12, 2021
The goal of the `symbol-collector` target is to continue automating the release of [`sentry-java`](https://github.com/getsentry/sentry-java) (Android and Java). #258 automated publishing to Maven Central, and this PR automates uploading symbols to the Android Bucket.
@BYK BYK added this to the Added Maven Target milestone Sep 14, 2021
BYK pushed a commit that referenced this pull request Oct 19, 2026
Mitigate the two open Dependabot alerts with pnpm dependency patches.
Neither advisory currently identifies a fixed upstream release, and
`http-cache-semantics@4.3.0` still reproduces the reported cache-reuse
flaw.

- [Alert #258 /
GHSA-vfj7-8cjw-p6xm](https://github.com/getsentry/craft/security/dependabot/258):
bound `braces@3.0.3` AST nesting to 100 levels, counting both
parentheses and braces. This protects both the runtime Vercel/micromatch
dependency and the Sentry build plugin's watcher. Escaped, quoted, and
character-class literals retain their behavior.
- [Alert #252 /
GHSA-ch52-4w7c-c8xp](https://github.com/getsentry/craft/security/dependabot/252):
update the docs dependency to 4.3.0 and share a reuse guard across
request evaluation, expiry, TTL (used directly by Astro), and stale
fallback APIs. Neither client `max-stale`, `stale-while-revalidate`, nor
`stale-if-error` can override non-storable, `no-cache`, shared-cookie,
shared `proxy-revalidate`, or wildcard `Vary` restrictions.
`must-revalidate` retains its fresh lifetime without stale extensions.
Error fallback also checks URL, host, method, and `Vary` identity before
reusing a response. Ordinary expiry and explicitly public/private-cache
cookie behavior remain supported.

Add six root regressions and thirty-three docs regressions, including
Astro's actual remote-image loader against the actual transitive
packages. The docs build runs its regressions, and Docker copies the
root patch before its frozen install. Patch provenance and removal
criteria are documented in `patches/README.md`.

Authenticate Changelog Preview release discovery with the workflow token
through `gh api`, avoiding the unauthenticated 403 that blocked CI. Add
three installer regressions covering latest, missing-tag fallback, and
explicit tags; asset downloads do not receive authorization headers.

Validation: reproduced the unsafe behavior before patching; all 39
security regressions pass afterward. Root and docs frozen installs pass
with CI's pnpm 10.27.0. Type checking, lint, formatting, CLI
build/`--help`, and the 29-page docs build pass. Docs audit reports zero
vulnerabilities.

Local root-suite baseline (`TZ=UTC pnpm test`): 1,561 passed, 3 skipped,
3 failed. The same failures reproduced on unmodified master on macOS:
Action test `uses the full workspace path in publish request titles`,
and dry-run E2E tests `produces consistent output format`
(temporary-path snapshot) and `executes pre-release command and shows
diff of changes` (GNU/BSD sed). Docker could not be built locally
because no daemon is running; hosted checks cover it.

The root audit still reports the locally patched `braces@3.0.3` by
version. Dependabot may keep #258 open until an upstream fixed release
exists; this PR does not suppress or dismiss the alert. These are local
mitigations, not a claim that upstream packages or every version-based
scan are fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants