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

Add an option to prevent repo-references from being added to a p2-repo #2742

Merged
merged 1 commit into from
Sep 5, 2023

Conversation

HannesWell
Copy link
Member

Add a new parameter named 'excludedRepositoryReferences' to the AssembleRepositoryMojo to prevent (mainly the automatic) addition of repository references with matching locations.
This can be used with ANT-style or Java RegEx patterns as follows:

<excludedRepositoryReferences>
	<excluded>https://foo.bar.org/component1/**</excluded>
	<excluded>%regex[http(s)?:\/\/bar\.org\/hidden.*]</excluded>
</excludedRepositoryReferences>

The is especially convenient in combination with the automatic addition of IU Target-Repository or POM-Repository references, if some but not all repos should be added.

One use-case of this is for example eclipse-m2e/m2e-core#1222.

@HannesWell HannesWell added the backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change label Sep 2, 2023
@github-actions
Copy link

github-actions bot commented Sep 2, 2023

Test Results

   561 files  ±0     561 suites  ±0   4h 16m 28s ⏱️ - 10m 15s
   362 tests +1     356 ✔️ +1    6 💤 ±0  0 ±0 
1 086 runs  +3  1 067 ✔️ +3  19 💤 ±0  0 ±0 

Results for commit 91064a5. ± Comparison against base commit 21d8a91.

♻️ This comment has been updated with latest results.

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Looks good any chance we can have an itest to verify this works (and will work in the future)?

@HannesWell
Copy link
Member Author

Looks good any chance we can have an itest to verify this works (and will work in the future)?

Will try that.

@HannesWell HannesWell force-pushed the excludeReferences branch 2 times, most recently from 43561d2 to db4be9a Compare September 3, 2023 16:40
@HannesWell
Copy link
Member Author

Looks good any chance we can have an itest to verify this works (and will work in the future)?

Added a test-case and simplified the existing reference test to use the P2Repo Xpath Tools.

@HannesWell
Copy link
Member Author

We could consider to just filter those repositories that are added automatically. If one adds a repo-reference in the category.xml explicitly, I find it hard to think of a use-case where one should later want to have it filtered out, since they have no other purpose than being added to the repo.

@laeubi
Copy link
Member

laeubi commented Sep 4, 2023

We could consider to just filter those repositories that are added automatically.

Sounds reasonable.

Copy link
Member

@laeubi laeubi left a comment

Choose a reason for hiding this comment

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

Looks good

Add a new parameter named 'repositoryReferenceFilter' to the
AssembleRepositoryMojo to better control the automatic addition of
repository references with matching locations.
This can be used with ANT-style or Java RegEx patterns as follows:

<repositoryReferenceFilter>
	<exclude>
		<location>https://foo.bar.org/hidden/**</location>
		<location>https://foo.bar.org/secret/**</location>
	</exclude>
	<include>%regex[http(s)?:\/\/foo\.bar\.org\/.*]</include>
</repositoryReferenceFilter>

The is especially convenient in combination with the automatic addition
of IU Target-Repository or POM-Repository references, if some but not
all repos should be added.
@HannesWell
Copy link
Member Author

We could consider to just filter those repositories that are added automatically.

Sounds reasonable.

Changed it that way now and also removed the plural s from filters since I think it is one filter that has different parameters/components.

@HannesWell
Copy link
Member Author

Platform Aggregator build failure is likely due to the incomplete transistion to Eclipse 4.30, thus merging.

@HannesWell HannesWell merged commit 5d0845e into eclipse-tycho:master Sep 5, 2023
9 of 10 checks passed
@github-actions
Copy link

github-actions bot commented Sep 5, 2023

💔 All backports failed

Status Branch Result
tycho-4.0.x Backport failed because of merge conflicts

You might need to backport the following PRs to tycho-4.0.x:
- Support repository references

Manual backport

To create the backport manually run:

backport --pr 2742

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-to-tycho-4.0.x Can be added to a PR to trigger an automatic backport of the change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants