sonatype-nexus-community / nexus-repository-apt

A Nexus Repository 3 plugin that allows usage of apt repositories
Eclipse Public License 1.0
105 stars 50 forks source link

Feature request: Multiple distributions in the same repository #22

Open paol opened 6 years ago

paol commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

DarthHater commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

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

mpoindexter commented 6 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

I think this one would be pretty easy, I outlined how it could be done here: https://github.com/sonatype-nexus-community/nexus-repository-apt/issues/22#issuecomment-354947808

mpoindexter commented 5 years ago

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 commented 5 years ago

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

fdvieira commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

Hi,

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

Thanks

fdvieira commented 5 years ago

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 commented 5 years ago

@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 commented 4 years ago

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