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

(CODEMGMT-1415) SPIKE assume modules unchanged locally #1145

Closed
wants to merge 3 commits into from

Conversation

justinstoller
Copy link
Member

Please add all notable changes to the "Unreleased" section of the CHANGELOG in the format:

- Summary of changes. [Issue or PR #](link to issue or PR)

@dirname = dirname
@owner, @name = parse_title(@title)
@path = Pathname.new(File.join(@dirname, @name))
@version = find_version(args)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need all these fields? Is there some hidden contract that requires them?

Copy link
Member Author

Choose a reason for hiding this comment

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

We need the version and name in the current implementation (which requires the title). I thought we might need the path but I don't think so. This file was just a copy and pared down version of the module base class.

@justinstoller justinstoller marked this pull request as ready for review April 15, 2021 19:09
@justinstoller justinstoller requested a review from a team April 15, 2021 19:09
@justinstoller
Copy link
Member Author

This is still a spike, but I'm opening it up as "ready for review" so that those subscribing can learn about it. Especially, regarding the efficacy of this change and the UX around --assume-unchanged. /cc @reidmv

@modules << mod
# We want to manage the content (and not purge it) even if we do not want
# to sync modules that we assume unchanged.
no_change ? @modules : @modules << mod
Copy link
Contributor

@reidmv reidmv Apr 19, 2021

Choose a reason for hiding this comment

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

I worry about focusing effort on the Puppetfile, when I see the future direction being more "modules attached to an environment", with the Puppetfile being kind of a legacy way to attach them.

Is it possible to take something like this approach instead?

  1. Add something like #insync? and #insync= methods to module objects. Also #insync to get the detailed value.
  2. In the Puppetfile, set mod.insync = true/false/:unknown as appropriate. When :unknown, #insync? returns false.
  3. Instead of adding logic to mask the existence of the module here in the Puppetfile code, figure out where the module is actually synced/verified, and put an ... unless mod.insync? there. I think that might be in the environment deploy action (to pass e.g. an @verify flag) and/or in the module sync method.

That approach would also preserve the ability to "see" all modules attached to an environment, regardless of what you're planning on doing to/with them.

Again, mostly I'm just worried about embedding important logic in the Puppetfile specifically, given that the Puppetfile is only one way to define environment content. At some point a general encapsulation/cleanup of how environments and modules relate would be nice, but in the meantime I think not implementing new stuff as Puppetfile-specific would be a good idea.

@justinstoller
Copy link
Member Author

One thing I've noticed with this is that the environment info that is written will no longer include the full module list like it currently does. (when investigating this I also opened this PR to clean up writing that info a little: #1148)

@github-actions
Copy link

This PR has been marked stale because it has had no activity for 60 days. If you are still interested in getting this merged, please comment and we'll try to move it forward. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the stale label Jun 20, 2021
@Magisus
Copy link
Collaborator

Magisus commented Jun 21, 2021

Not stale 🙂

@github-actions github-actions bot removed the stale label Jun 22, 2021
@mwaggett mwaggett added do not merge feature has jira ticket Label for issues that are duplicated in Jira labels Aug 5, 2021
@Magisus
Copy link
Collaborator

Magisus commented Aug 20, 2021

I think this has been superseded by #1200, going to close it. Please reopen if you still need it for something.

@Magisus Magisus closed this Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge feature has jira ticket Label for issues that are duplicated in Jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants