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 a way to skip reference repositories #505

Closed
wants to merge 1 commit into from

Conversation

tivervac
Copy link
Contributor

This goes hand in hand with the PR in PDE. If there's a way to achieve this without editing the public API in IPlanner, I would much prefer it.

Seeing how FOLLOW_ARTIFACT_REPOSITORY_REFERENCES was always hardcoded to true in ProvisioningContext, I feel like someone wanted to implement something similar at some point, but didn't get around to it.

For versioning, I just followed the quick fixes, I hope this is correct.

@merks
Copy link
Contributor

merks commented Apr 24, 2024

I’ll look in detail tomorrow. I just wonder how p2 director already supports the -followReferences option (off by default) with the current implementation.

https://help.eclipse.org/latest/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_director.html

I also recall when oomph’s p2 director task didn’t follow references and I had change something to enable that. That’s a few years back…

@laeubi
Copy link
Member

laeubi commented Apr 25, 2024

@tivervac the value is hardcoded in the constructor but code creating the provisioning context can still override that value by calling setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, "false") so I don't think we need a new constructor parameter but make the property public.
@merks thats exactly how DirecorApplication works, but currently uses a copy of the constant FOLLOW_ARTIFACT_REPOSITORY_REFERENCES

Also note that there is another property FOLLOW_REPOSITORY_REFERENCES for metadata repositories what already is public.

@merks
Copy link
Contributor

merks commented Apr 25, 2024

This is specifically where the director application configures that:

context.setProperty(ProvisioningContext.FOLLOW_REPOSITORY_REFERENCES, String.valueOf(followReferences));
context.setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, String.valueOf(followReferences));

So I don't think this PR is needed because one can always achieve the goal by configuring the context properties.

@laeubi
Copy link
Member

laeubi commented Apr 25, 2024

So I don't think this PR is needed because one can always achieve the goal by configuring the context properties.

As mentioned the property is private, we should make it public instead of maintain just another copy at PDE soon.
Beside that, it might be worth to have a method ProvisioningContext#setFollowReferences(boolean) that simply sets both properties to true/false to cover the common case and make this more obvious.

@merks
Copy link
Contributor

merks commented Apr 25, 2024

Let's not pollute the API with convenience methods that then must interact properly with the property settings. In any case, that's not what this PR does.

Note that this is public:

But this is not:

That one could and probably should be made public and that would avoid the copy in the director:

image

But that's also not what this PR does. So we don't need this PR but a different PR to make the constant public seems helpful.

@tivervac
Copy link
Contributor Author

@tivervac the value is hardcoded in the constructor but code creating the provisioning context can still override that value by calling setProperty(FOLLOW_ARTIFACT_REPOSITORY_REFERENCES, "false") so I don't think we need a new constructor parameter but make the property public. @merks thats exactly how DirecorApplication works, but currently uses a copy of the constant FOLLOW_ARTIFACT_REPOSITORY_REFERENCES

Also note that there is another property FOLLOW_REPOSITORY_REFERENCES for metadata repositories what already is public.

Right, the copy is what threw me off. I did a find references on FOLLOW_ARTIFACT_REPOSITORY_REFERENCES and didn't see it used in any set context. I'll make the constant public to make sure other people don't hit the same mistake. Once I've confirmed that setting the properties solves my issue, I'll close this PR. Thanks for the help both!

@tivervac
Copy link
Contributor Author

Settings the property works for my usecase \o/

@tivervac tivervac closed this Apr 25, 2024
@merks
Copy link
Contributor

merks commented Apr 25, 2024

@tivervac

Thanks for taking the time to contribute to such a complex project where it's all too easy to be thrown off by the endless details!

@tivervac
Copy link
Contributor Author

Replaced by #506

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.

3 participants