Add support for repository tags#6116
Merged
pkriens merged 13 commits intobndtools:masterfrom Jun 21, 2024
Merged
Conversation
e.g. add a property tags="baseline,release, foo";\ to a Repository in build.bnd tags="baseline,release, foo";\ Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
example: -runrepos: \ Workspace,\ @resolve this adds the Workspace repo and all other repos tagged with the tag 'resolve' I used the '@' character as a marker for tags (for now). initially I wanted to use '#' but this is a comment in a .bndrun file. With this i got a successful resolution as before Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Contributor
Author
Summary from the bnd zoom call today:
That's it so far. I will post an update once I have this implemented and from there we can discuss the next step. Thanks @pkriens for the input. |
- this commit partly reverts previous commit - repos now get the 'resolve' tag by default if not specified - .bndrun: empty -runrepos will be populated with all repos having the 'resolve' tag - .bndrun: resolution consider all repos having the 'resolve' tag. that means you can exclude a repo from resolution by manually assigning it a different tag (e.g. to exclude the baseline repo from resolution, you should give the baseline-repo e.g. the tag 'baseline' and make sure it does NOT have the 'resolve' tag Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Contributor
Author
@pkriens I have implemented the above.
Example: this is my Repositories list with no
It is basically all repos with the resolve tag (repos have not tags specified, so the default 'resolve' is used) Resolution:
Quoting commit b9a574f
Let's discuss |
pkriens
reviewed
May 17, 2024
Member
pkriens
left a comment
There was a problem hiding this comment.
Looks good to me. You can take the recommendations:
- extend RepositoryPlugin with Tagged
- Maybe make a Tags class, extending Set
- not parsing the string all the time
biz.aQute.repository/test/aQute/bnd/repository/maven/provider/WorkspaceTest.java
Outdated
Show resolved
Hide resolved
- extend RepositoryPlugin with Tagged - make a Tags class, extending Set - not parsing the string all the time - replace RepoTags enum with Constants.REPOTAGS_RESOLVE Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Somehow I think it belongs there. Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
pkriens
reviewed
May 20, 2024
fix and improve testcase to test for consistent sorting of tags Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
- keep backwards compatibility so that Repos without tags return an empty set and empty set means "matches" - renamed Tags.matchesTags to Tags.isIncluded - move tags to own package aQute.bnd.service.tags Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
Contributor
Author
I think that better reflects the intent. - also adjusting javadoc accordingly - and move static methods to bottom Signed-off-by: Christoph Rueger <chrisrueger@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #5966
Based on brainstorming here https://bnd.discourse.group/t/baseline-repo-exclude-from-the-build-path/391/6
In this PR
tags="baseline,release, foo"to a Repository inbuild.bnd.bndrunif you remove the-runreposyou get all repositories which have either no tags set or the 'resolve' tagresolve(but instead any other tag e.g.<<EMPTY>>and remove the-runreposfrom the.bndrun.-runreposthen today's behavior is still in place that the given repo names are usede.g. a
.bndrunfile without-runreposwould include the following repos in the resolution:because it has the
resolvetagand
because there is no tags
but not
because it has a no
resolvetag.To exclude the baseline repo in the example, you would not add the
resolvetag to the baseline-repo, and then it won't be considered for Resolving. I have not used baselining yet, so I am not familiar with the topic and what areas are not covered by this.The current state of the PR just lay the foundation for tagging. More features could be added like allowing for NOT or more sophisticated filter expressions.