Skip to content

Conversation

BrunoMiguelNogueira
Copy link

@BrunoMiguelNogueira BrunoMiguelNogueira commented Sep 11, 2025

WHAT

Adds the latest stable snapshot version to README as a badge.

WHY

Due to security reasons, Sonatype removed browsing of central.sonatype.com/repository/maven-snapshots.

FURTHER NOTES

Since we have no way of accessing the snapshot's repository, the badge uses the already existing version value from the latest stable upload.

(example)
image

Closes

@bmg13
Copy link
Contributor

bmg13 commented Sep 12, 2025

just reviewed and am okay to merge, just please update the description with an image of the outcome so that there are no surprises.

Copy link
Contributor

@lgblaumeiser lgblaumeiser left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, unfortunately, this is not what was intended with the issue. The problem is, that the central snapshot repository does not allow to browse anymore. Therefore, it is not easily possible to determine the latest versioned snapshot.

The idea was, to intergrate something into the github workflow which actually pushes the artifacts to central maven snapshot repository, as this workflow knows which version it has just pushed.

@bmg13
Copy link
Contributor

bmg13 commented Sep 12, 2025

@lgblaumeiser I see your point here, still I would consider the value added by this PR.
@BrunoMiguelNogueira maybe we create an issue just for this change and remove the link to the existing issue.

@lgblaumeiser
Copy link
Contributor

@lgblaumeiser I see your point here, still I would consider the value added by this PR.

But that is just information that you can see from a static file in the repository. It is only one line of code, but it needs to be managed and if it fails, time needs to be spend to fix it. For me, it is not enough benefit to have it, to be honest.

@bmg13
Copy link
Contributor

bmg13 commented Sep 15, 2025

But that seems to be actually what was decided in this issue #2076 (comment).

Do we need to list them all, or is it just enough to have the latest rightly available?
For the last case we could add a badge to our main readme that links to the latest snapshot.

And seems to be what is implemented in this PR.

@lgblaumeiser
Copy link
Contributor

But that seems to be actually what was decided in this issue #2076 (comment).

Do we need to list them all, or is it just enough to have the latest rightly available?
For the last case we could add a badge to our main readme that links to the latest snapshot.

And seems to be what is implemented in this PR.

Hi @bmg13, that is the misunderstanding, the issue is about the latest versioned snapshot available for dependency resolving for adoptors, i.e., in maven central. We build a 0.11.0-20250915-SNAPSHOT version which we ship now to maven central instead of previously the ossh repository. The issue is, that the snapshot repo in maven central does not allow browsing, at least when I last looked at, due to security reasons. So if someone wants to update dependencies to our latest snapshot, he has no way of finding out the exact version string, so he can not update to the snapshot. The idea of the issue was, that we provide information on published versioned snapshots in the repository and Rafael and I agreed to only point out the last published snapshot, not a list of available ones.

This is why I request changes, because the solution in the PR does not meet the requirement expressed in #2076, which is, telling people which version string to use, if they, e.g., want to create their own connector runtime pointing to the maven central snapshot repository for resolving dependencies.

@BrunoMiguelNogueira BrunoMiguelNogueira force-pushed the latest-available-snapshot-as-badge branch from 75a0db3 to 3255861 Compare September 15, 2025 13:36
@BrunoMiguelNogueira
Copy link
Author

BrunoMiguelNogueira commented Sep 17, 2025

@lgblaumeiser I think I’m starting to get a clearer idea of what you want as a solution, though I still have some questions.

After reviewing the actions and the way we create snapshots in the format you call versioned, I’ve identified two options:

  • by inputting the version manually
  • by a schedule

When I check the old repository’s entries and timestamps, it seems that the badge should update with both types of snapshot creation. Is this correct?

I believe there are two scenarios the badge should cover:

  1. When a versioned snapshot is uploaded to Maven Central → Display the new version
image
  1. When a versioned snapshot upload fails → Display an error message
image

Additionally, the badge mustn’t update if the snapshot is not versioned.

Do these scenarios cover what you had envisioned as a solution?

@lgblaumeiser
Copy link
Contributor

Hi @BrunoMiguelNogueira, see my answers below

@lgblaumeiser I think I’m starting to get a clearer idea of what you want as a solution, though I still have some questions.

When I check the old repository’s entries and timestamps, it seems that the badge should update with both types of snapshot creation. Is this correct?

The badge should reflect the last versioned snapshot build, whether done manually or scheduled does not matter.

  1. When a versioned snapshot upload fails → Display an error message

I would say, that it should keep the old content. It should always point to the last available versioned snapshot, why versioned, because this is stable, as a user that wants to test something can depend on a non-changing thing. Depending on the last unversioned snapshot adds changes under the hood, which is not wanted in such a scenario, right. The last versioned one is the best we can offer, if an upload failed, we cannot provide a better version, but the old is still there.

Additionally, the badge mustn’t update if the snapshot is not versioned.

Exactly as motivated in the last point, right?

@BrunoMiguelNogueira BrunoMiguelNogueira force-pushed the latest-available-snapshot-as-badge branch from 3255861 to 85ef787 Compare September 22, 2025 13:58
@github-project-automation github-project-automation bot moved this from Open to Done in EDC PR Board Sep 22, 2025
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Copy link
Contributor

@lgblaumeiser lgblaumeiser left a comment

Choose a reason for hiding this comment

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

Much close, one thing still, though

if [ -n "$UPDATE_BADGE" ]; then
sed -i "s|^\[snapshot-shield\]:.*|[snapshot-shield]:https://img.shields.io/badge/latest--snapshot-$ESCAPED_VERSION-blue?style=for-the-badge|" 'README.md'
fi
- name: Commit changes
Copy link
Contributor

Choose a reason for hiding this comment

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

That is not the best practice, as badge changes should not create a trace in the repositories history. I found several solutions for such badges which provide the data using an api that stores the intermediate value. I think I remember, that it is possible to use an workflow artifact that is used as data, or something like that.

And please take care, that the file end with a newline, thanks!

Choose a reason for hiding this comment

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

I’ve looked into it and haven’t found a way to do this without a commit or new dependencies.
Since the version is only defined within the Action:
• Static badge: We would need to commit the updated version each time (current approach).
• Dynamic badge: We would need a publicly accessible data source fed from the Action.

From what I understand, Action outputs and artifacts cannot be accessed publicly, so the version must be persisted somewhere accessible to use it for a dynamic badge.
That leads us back to the commits, and the only way this wouldn't leave a trace in tractus would be by using an external storage, which would add a dependency.

If you have any other possibility that you would like me to try and explore let me know.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants