Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

await-artifact only checks sonatype repo, not maven central #132

Closed
SylvainJuge opened this issue Sep 23, 2024 · 2 comments · Fixed by #133
Closed

await-artifact only checks sonatype repo, not maven central #132

SylvainJuge opened this issue Sep 23, 2024 · 2 comments · Fixed by #133

Comments

@SylvainJuge
Copy link
Member

The await-artifact seems to only check on "https://oss.sonatype.org/service/local/artifact/maven/... for artifact publication, which is usually a good proxy for actual publication in maven central in https://repo1.maven.org/maven2/....

However, this is apparently not always the case and it can happen that the sonatype repo responds with 200 status code and not maven central.

For example with the following 1.52.0 as I am writing this, with the following shell script:

#!/bin/bash -x

RELEASE_VERSION=1.52.0
RELEASE_VERSION_TAG=v1.52.0
ARTIFACT_ID=elastic-apm-agent
GROUP_ID=co.elastic.apm
VERSION=1.52.0

# same command as await-artifact
curl -L -I "https://oss.sonatype.org/service/local/artifact/maven/redirect?r=releases&g=${GROUP_ID}&a=${ARTIFACT_ID}&v=${VERSION}"

# where we actually assume the artifact to be published
curl -I "https://repo.maven.apache.org/maven2/co/elastic/apm/elastic-apm-agent/${VERSION}/"

The 1st curl returns a 307 for redirect, then we get a 200.

The second curl in maven central returns 404 which means the artifact is not yet publicly available.

So as an extra safety it would likely be better to check for actual maven central publication than relying on sonatype repository for releases. For snapshots however it is still relevant to only check the sonatype repo.

@SylvainJuge
Copy link
Member Author

Well, this seems mostly related to the fact that while the global maven central status is apparently OK, the publication latency is very high as seen in the last chart here:

Image

@v1v
Copy link
Member

v1v commented Sep 23, 2024

For the record, the original implementation was done in https://github.com/elastic/apm-pipeline-library/commits/main/.github/actions/await-maven-artifact

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 a pull request may close this issue.

2 participants