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

Add a 'branch_only' parameter for /module #134

Merged
merged 3 commits into from
Feb 11, 2024

Conversation

raincz
Copy link
Contributor

@raincz raincz commented Jan 3, 2024

When passing this parameter, it tries to detect the branch from the module as well and apply it using the -e parameter to r10k. For modules that are branch-linked with the main repository, this will trigger an update only to the respective environment, rather than all environments.

  • For pushes into a branch of the module corresponding to an environment, this merely saves processing time.
  • For pushes to the default branch (of the module) which would affect all environments, this will block updates to all environments except for the default one (ie. production). This helps prevent unsolicited updates of an environment that could break it, until the environment itself is updated by other means (eg. by pushing into the respective branch of the source repository or module).

When passing this parameter, it tries to detect the branch from the
module as well and apply it using the -e parameter to r10k. For modules
that are branch-linked with the main repository, this will trigger an
update *only* to the respective environment, rather than all
environments.

* For pushes into a branch of the module corresponding to an
environment, this merely saves processing time.
* For pushes to the default branch (of the module) which would affect
all environments, this will block updates to all environments except
for the default one (ie. production). This helps prevent unsolicited
updates of an environment that could break it, until the environment
itself is updated by other means (eg. by pushing into the respective
branch of the source repository or module).
@raincz
Copy link
Contributor Author

raincz commented Jan 3, 2024

This addresses issue #133 as described.

@dhollinger
Copy link
Member

Where does the branch_only option come from? The incoming request? A header? A config option?

I see the logic for acting on if branch_only gets passed in, but not where it can get set.

@dhollinger dhollinger self-assigned this Jan 15, 2024
@dhollinger dhollinger added the enhancement New feature or request label Jan 15, 2024
@raincz
Copy link
Contributor Author

raincz commented Jan 18, 2024

(sorry, missed the notification) It comes from the URL. ie http://<host:port>/api/v1/r10k/module?branch_only=1

@raincz
Copy link
Contributor Author

raincz commented Jan 18, 2024

A personal note to our use case: Gitlab (or any other git manager for that matter) doesn't really understand your puppet structure, or which repository is base puppet and which is a module. But they usually have the webhooks configured on a per-repository basis, so it makes sense that you would have the ability to distinguish/force this sort of stuff directly in a particular webhook URL. You already have to switch between api/.../environment and api/.../module anyway, so adding other context-dependent options was the most logical implementation for me.

@raincz
Copy link
Contributor Author

raincz commented Feb 10, 2024

Hello @dhollinger , is there anything else I should do for this? Any issues with the patch I should fix?

@dhollinger
Copy link
Member

I have to look into why it isn't letting me merge. The GitHub Android app isn't clear on the reason. I'll take a look at it a little later today. If I get it fixed, I can get it merged

@dhollinger dhollinger merged commit 8e91113 into voxpupuli:master Feb 11, 2024
3 checks passed
@raincz
Copy link
Contributor Author

raincz commented Feb 11, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants