Skip to content

Conversation

jordanbreen28
Copy link

@jordanbreen28 jordanbreen28 commented May 8, 2024

Prior to this PR, a custom insync message was not honoured when applying a manifest in noop mode. This was later tracked down to the offending noop method found in the resource harness class, which did not call the change_to_s method to retrieve the custom insync message.

I've updated the method to match that of the sync method below, ensuring that the functionality of the custom isync provider feature is not any different whether running puppet in noop or no-noop mode.

Can see the two methods here

Additional Context

Have opted out of adding a space between (noop) and audit_message to match the three other implementations of this in the sync and noop methods.

@jordanbreen28 jordanbreen28 added the bug Something isn't working label May 8, 2024
@jordanbreen28 jordanbreen28 changed the title (bug) - Honour custom insync in noop mode (bug) - Honour custom insync message in noop mode May 8, 2024
@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from fb91f78 to 2d9d761 Compare May 8, 2024 14:35
@jordanbreen28 jordanbreen28 marked this pull request as ready for review May 8, 2024 14:54
@jordanbreen28 jordanbreen28 requested a review from a team as a code owner May 8, 2024 14:54
@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from 2d9d761 to 21f5b19 Compare May 8, 2024 15:06
@joshcooper
Copy link
Contributor

Thanks @jordanbreen28 Is there a particular module we can use to demonstrate the issue?

@jordanbreen28
Copy link
Author

jordanbreen28 commented May 9, 2024

hey @joshcooper this actually came through to us as a bug for the resource_api in this issue puppetlabs/puppet-resource_api#307. You can see in this comment that after a bit of playing around I was able to replicate this problem.

AFAIK there is no module I can think of that uses a custom insync message, I had to implement my own version of this example in a dsc module I had lying about in one of my environments open. puppetlabs-firewall firewallchain type includes the custom_insync feature and has an custom insync? method here in its provider, so it might be easier to take that module and update that method to return some custom message.

@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from 21f5b19 to aa8ee3a Compare May 29, 2024 09:02
@joshcooper
Copy link
Contributor

Thanks @jordanbreen28 Could you add a test for this case (should be in spec/unit/transaction/resource_harness_spec.rb) and rebase your PR to pick up some changes to fix Windows failures with 8.3 filenames?

@jordanbreen28
Copy link
Author

@joshcooper sure! I'll try get some tests added shortly

@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from aa8ee3a to bf9ba0f Compare July 3, 2024 16:03
@jordanbreen28
Copy link
Author

hey @joshcooper, got a unit test added. Hope that suffices!

@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from bf9ba0f to cb92487 Compare July 4, 2024 08:49
Copy link
Contributor

@joshcooper joshcooper left a comment

Choose a reason for hiding this comment

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

LGTM, could you squash your commits?

@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from cb92487 to 201c2ac Compare July 11, 2024 08:10
@jordanbreen28
Copy link
Author

jordanbreen28 commented Jul 11, 2024

@joshcooper squashed 🙂 rubocop errors seem unrelated..

@joshcooper
Copy link
Contributor

@jordanbreen28 rubocop released a new gem that flagged some buggy code in puppet. That's since been resolved. Can you rebase your PR against the main branch?

Prior to this commit, a custom insync message was not honoured when
applying a manifest in noop mode. This was later tracked down the the
`noop` method found in the resource harness class.

I've updated the method to match that of the `sync` method below,
ensuring that the functionality of the custom isync provider feature is
not any different whether running puppet in noop or no-noop mode.
@jordanbreen28 jordanbreen28 force-pushed the bug-honour_custom_insync_in_noop branch from 201c2ac to 365c5a6 Compare July 16, 2024 07:56
@jordanbreen28
Copy link
Author

@joshcooper done!

@joshcooper
Copy link
Contributor

jenkins please test this

1 similar comment
@joshcooper
Copy link
Contributor

jenkins please test this

@joshcooper
Copy link
Contributor

jenkins please test this on redhat8-64

@joshcooper
Copy link
Contributor

@jordanbreen28 could you push your PR to your fork of puppet?

@jordanbreen28
Copy link
Author

@joshcooper done! Closing in favour of #9443

@jordanbreen28 jordanbreen28 deleted the bug-honour_custom_insync_in_noop branch August 6, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants