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

Closes #84: Introduce the max_active_branches config parameter #100

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

jeremystretch
Copy link
Contributor

Fixes: #84

  • Introduce the max_active_branches config parameter
  • Enforce it upon the creation of each new Branch

Copy link
Contributor

@arthanson arthanson left a comment

Choose a reason for hiding this comment

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

The code works but I think the nomenclature is confusing. In the branches table there is an "is_active" flag and it is used to denote which branch is currently active, but here we are using active to denote non merged branches.

If this was set and I got the error the first thing I'd do is go look at my branches table to see which ones are not needed, but I see I don't have any active branches (or at most 1) so I'd be like why did I get this message... I think the table should easily show which branches are in the state that this flag refers to.

Branches | NetBox 2024-09-10 08-53-25

@jeremystretch
Copy link
Contributor Author

jeremystretch commented Sep 10, 2024

@arthanson thanks that's a really good catch. Maybe we should refer to these branches as "operational" rather than "active."

@jeremystretch
Copy link
Contributor Author

I settled on max_working_branches as the config parameter name.

netbox_branching/models/branches.py Outdated Show resolved Hide resolved
@jeremystretch jeremystretch merged commit e5ba5d1 into develop Sep 10, 2024
7 checks passed
@jeremystretch jeremystretch deleted the 84-max_active_branches branch September 10, 2024 18:27
jeremystretch added a commit that referenced this pull request Sep 12, 2024
* Closes #84: Introduce the max_active_branches parameter

* Rename max_active_branches to max_working_branches

* Update error message
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.

Add a config parameter to limit the number of active branches
2 participants