Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Feature request: Multiple distributions in the same repository #22

Open
paol opened this issue Nov 28, 2017 · 19 comments
Open

Feature request: Multiple distributions in the same repository #22

paol opened this issue Nov 28, 2017 · 19 comments

Comments

@paol
Copy link

paol commented Nov 28, 2017

It would be nice to have multiple distributions in the same repository. As it it we have to create a new repository for each distribution.

I suppose this would require changing the upload URL for packages.

@mpoindexter
Copy link
Contributor

I think this is probably a nice feature, but I'm unlikely to work on it (decent amount of effort required, not something I need). Patches welcome.

@paol
Copy link
Author

paol commented Dec 2, 2017

So, I accidentally discovered this feature seems to be 90% of the way done: if you go into the repository properties and change the distribution name (which is editable - I assume by mistake), the next upload will create the structure for that distribution. You can keep editing the distribution back and forth and everything seems to work, though I didn't test exhaustively.

So it seems the only thing missing is for the distribution name to be picked up from the upload URL. Backward compatibility can be kept by defaulting to the distro set in the repository properties, if the upload URL does not have one.

@mpoindexter
Copy link
Contributor

Reviewing the code it doesn't seem like this would be incredibly difficult. Basically, what would have to be done is:

  • Refactor AptFacet.getDistribution to return a list of distributions
  • Make FacetHelper.getReleaseIndexSpecifiers deal with multiple distributions
  • Make FacetHelper.getReleasePackageIndexes deal with multiple distributions
  • Revamp AptHostedFacet ingestAsset/rebuildIndexes to take the distribution as a parameter
  • Change AptHostedHandler to accept an OPTIONAL specification of a distribution. If no distribution is selected, then default to the first distribution returned from getDistribution.
  • Make the implementations of AptFacet take a comma separated list of distributions instead of just a single distribution, and change the implementations of getDistribution() to split and return the list.

@DarthHater
Copy link
Member

This smells similar to something we had to handle for Yum in Nexus Repo 3. @jlstephens89 might have some pointers for you.

@j-s-3
Copy link
Contributor

j-s-3 commented Feb 8, 2018

@DarthHater I'm taking a look at this today. I need some time to get into the code / apt so don't expect an immediate fix but I'll keep everyone updated.

@j-s-3
Copy link
Contributor

j-s-3 commented Feb 8, 2018

@mpoindexter I'm trying to work out what proxy uses the distribution configuration for? Can't that be determined from the request?

@mpoindexter
Copy link
Contributor

I think the biggest reason is for the snapshot support. This controls what distributions we're going to copy when we take a snapshot. I guess it's also useful as a policy mechanism.

@Flow76320
Copy link

Hey !
Has it been fixed in newer versions? We currently installed a Nexus 3.13.0-01 with the corresponding APT plugin 1.0.8.
We are able to add a comma-separated list of distributions, update packages etc. But after some times, only the first element of the list remains.
Should we still add a repo per distribution?

I don't know if I hove to open a separate ticket, but the assets Packages et Sources can not be updated in a repo of type Apt (Proxy). I can see the "Deployment Policy" parameter for Apt (hosted), but not for the Proxy one. Any idea?

Thanks in advance

@mpoindexter
Copy link
Contributor

This has not been changed in newer versions. My suggestions above were for how someone could change the code to support a comma separated list of distributions, but no one has done this yet, so it's still unsupported. The current code requires a separate hosted repo per distribution.

@DarthHater
Copy link
Member

I might pick this up if you think it's fairly easy @mpoindexter and someone can help me test it. Any volunteers out there?

@mpoindexter
Copy link
Contributor

I think this one would be pretty easy, I outlined how it could be done here: #22 (comment)

@mpoindexter
Copy link
Contributor

FWIW, how we use this is to just simply have one hosted repo per distribution since the packages we upload tend to be built separately for each distribution, but I can see how this would be irritating if most of the packages you upload would work on multiple distributions.

@DarthHater
Copy link
Member

I guess that some other people are going to work on this! I'll back off :)

@fdvieira
Copy link

fdvieira commented Sep 13, 2019

Hello,

I know this moved to sonatype but I can't seem to find this on their Jira. Do you guys have any news on this? I tried comma-separated but I'm not entirely sure that it works.

Thanks.

@j-s-3
Copy link
Contributor

j-s-3 commented Sep 13, 2019

@fdvieira We investigated this when we were migrating the APT plugin to the core nexus codebase (https://github.com/sonatype/nexus-public/tree/master/plugins/nexus-repository-apt) and found that there were some technical limitations: The APT plugin currently rebuilds metadata on every .deb file change and uses the distribution configured against the repository to know what folder to create for the metadata. If we allowed multiple distributions we would need to some how record those distributions for each .deb file. This would be a lot of work to implement and would also not work with our metadata repair tasks.

Our current recommendation is to create multiple hosted repositories, one for each distribution. If that isn't possible for you feel free to file an improvement ticket on our public JIRA: https://issues.sonatype.org

@Flow76320
Copy link

Hi,

We've done this recommendation and it works like a charm for our needs.

Thanks

@fdvieira
Copy link

Hi @jlstephens89,

In the first place, thank you so much for the detailed explanation, I now understand why.

Second, it's not something I truly need since I can create a repository for each distribution. Although it would be a nice feature for the future. Do you think that if I open an improvement ticket it will be heard? :)

For now, I will use one repository per distribution.

Again, thanks a lot for the answer.

@j-s-3
Copy link
Contributor

j-s-3 commented Sep 13, 2019

@fdvieira Glad that works for you 👍

We monitor new tickets, that doesn't mean it will get implemented immediately but it does allow other users to then vote on the ticket/add their voice to it which will increase the priority.

@bhamail
Copy link
Contributor

bhamail commented Sep 27, 2019

APT is now part of Nexus Repository Manager. Version 3.17.0 includes the APT plugin by default.
If this is still an issue if using 3.17.0 or later please file an issue at https://issues.sonatype.org/.
Links to the new source code location are in the top level README.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants