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

do not recreate log_dir if it is already a symlink #1490

Merged
merged 2 commits into from
Apr 2, 2022

Conversation

level-a
Copy link
Contributor

@level-a level-a commented Dec 3, 2021

Pull Request (PR) description

do not recreate log_dir if it is already a symlink

@puppet-community-rangefinder
Copy link

nginx::config is a class

that may have no external impact to Forge modules.

This module is declared in 9 of 578 indexed public Puppetfiles.


These results were generated with Rangefinder, a tool that helps predict the downstream impact of breaking changes to elements used in Puppet modules. You can run this on the command line to get a full report.

Exact matches are those that we can positively identify via namespace and the declaring modules' metadata. Non-namespaced items, such as Puppet 3.x functions, will always be reported as near matches only.

@smortex
Copy link
Member

smortex commented Dec 8, 2021

Hum… I would precisely want the module to replace the symlink with a directory if it existed 🤔…

Maybe add a parameter like Boolean $manage_logdir = true and conditionally manage this resource?

@smortex
Copy link
Member

smortex commented Dec 17, 2021

The unit tests take forever to run but maybe it's worth updating them to check this new parameter in spec/classes/nginx_spec.rb?

@level-a
Copy link
Contributor Author

level-a commented Dec 17, 2021

bundle exec rake parallel_spec finished for 11m for me
not sure if I know how to properly add it to nginx_spec.rb
smth like this to RedHat and Debian section?

context 'manage_log_dir => true' do
  let(:params) { { manage_log_dir: true } }
  it { is_expected.to contain_file('/var/log/nginx') }
end

@smortex
Copy link
Member

smortex commented Dec 17, 2021

@level-a near line 342 / 352 add the replace parameter to ensure it has the proper false default value, then add a test like above with a true value and check that the non-default value is reflected in the file resource parameters.


When done, you can combine your commits in a single one (squash):

From your working directory:

git rebase -i origin/master # Interactively rewrite history

This will bring your editor. Keep the first line unchanged, and replace pick with squash for all subsequent lines. Save and quit, your editor will pop again and allow you to combine the commit messages in a single commit message.

Then push your updated branch to update this PR:

git push -f            # Send the changes (-f is required because we re-wrote history)

Copy link
Member

@root-expert root-expert left a comment

Choose a reason for hiding this comment

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

Maybe I'm missing something here, but why do we have to duplicate the spec on both Debian and RedHat?

Can't we add it to a common place? (for all supported OSes)

Copy link
Member

@root-expert root-expert left a comment

Choose a reason for hiding this comment

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

LGTM

@level-a level-a requested a review from smortex April 1, 2022 10:45
@root-expert root-expert merged commit 7a0787b into voxpupuli:master Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants