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

Expose notify_update to apt::source #596

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Expose notify_update to apt::source #596

merged 1 commit into from
Apr 12, 2016

Conversation

danielhoherd
Copy link

This solved a dependency cycle for us.

@@ -387,5 +387,41 @@
end
end

context "with notify_update = true (default)" do
Copy link

Choose a reason for hiding this comment

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

This is not true. You're using undef as the default which, by virtue of apt::setting have it set to true by default means it turns out to be true. Your test however isn't testing the default chain, it's explicitly setting it as true.

You should have two test cases for this. One not passing in anything and validating that it will notify and the second explicitly setting it to true and checking that it propagates.

Copy link
Author

Choose a reason for hiding this comment

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

Good catch. Fixed.

@daenney
Copy link

daenney commented Mar 18, 2016

Please squash this down to a single commit with a descriptive title and body.

@daenney
Copy link

daenney commented Mar 18, 2016

This solved a dependency cycle for us.

Could you elaborate? Before we add any feature we'd like an example of use case so we can estimate if this is a feature worth adding or if it's a "0.1% solved and issue for me" thing.

@danielhoherd
Copy link
Author

@daenney Here is the error that this patch solved:

Error: Could not apply complete catalog: Found 1 dependency cycle:
(Exec[apt_update] => Exec[silent_apt_update] => Package[apt-transport-s3] => File[/etc/apt/s3auth.conf] => Apt::Source[aptly_aptly_s3] => Apt::Setting[list-aptly_aptly_s3] => File[/etc/apt/sources.list.d/aptly_aptly_s3.list] => Apt::Setting[list-aptly_aptly_s3] => Apt::Source[aptly_aptly_s3] => Apt::Source[aptly_ubuntu_s3] => Apt::Setting[list-aptly_ubuntu_s3] => File[/etc/apt/sources.list.d/aptly_ubuntu_s3.list] => Exec[apt_update])

By using this patch, we can install apt-transport-s3 without causing a cycle. We use this so we can add the s3 transport, then place some s3 apt::source files, then do the update. Doing an update prior to placing the s3 transport and s3 apt::source files is irrelevant and could potentially cause problems.

We were unable to find another way to prevent triggering an update when defining an apt::source, which is why we made this patch. If there is another simple method to do this then I'd love to hear it.

Not having notify_update exposed seemed like a feature omission to me, or at least an inconsistency. This flag was already added to apt::conf and apt::pin in 9ad4fd6

@josephholsten
Copy link

would this allow us to remove /~https://github.com/puppetlabs/puppetlabs-apt#adding-new-sources-or-ppas? If so, I believe this is behaviour that 99.9% of users want.

Also, this no longer needs the needs-squash label.

@daenney
Copy link

daenney commented Apr 7, 2016

Not having notify_update exposed seemed like a feature omission to me, or at least an inconsistency. This flag was already added to apt::conf and apt::pin in 9ad4fd6

The reason for not exposing it was because no one has needed it before. This is how things go. We can't build 100% of all features anyone ever wants since sometimes that's not a good idea and other times we've simply not hit that use case/problem before. Even though one resource has the flag exposed it doesn't necessarily make sense to expose that same flag on everything else.

@daenney
Copy link

daenney commented Apr 7, 2016

@tphoney @hunner @bmjen I see no real issues w.r.t merging this. I think it makes sense though I doubt it resolves the problem @josephholsten mentioned.

@tphoney
Copy link

tphoney commented Apr 12, 2016

Ok @daenney i will merge this. It does look like we need a separate PR to address the issue raised by @josephholsten

@tphoney tphoney merged commit 015009d into puppetlabs:master Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants