[Feature] Add label variable interpolation in hook context #861
No reviewers
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#861
Loading…
Reference in New Issue
No description provided.
Delete Branch "codimp/borgmatic:label-variable-interpolation-in-hook-context"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
label
interpolation variable in hook context for current repository at runtime, likerepository
This looks great.. Thank you for doing it! Only a few minor comments below. Also, what do you think of adding a test that if a repository label is present, then it ends up in the hook context? You could model it after one of the existing tests, such as the one you updated.
@ -286,0 +286,4 @@
if 'label' in repository:
repository_label = repository['label']
else:
repository_label = ''
You could simplify this all to just:
repository_label = repository.get('label', '')
It could even be inline below without the temporary variable. (Do not feel strongly.)
Good idea!
@ -84,6 +84,8 @@ variables you can use here:
path of the borgmatic log file, only set when the `--log-file` flag is used
* `repository`: path of the current repository as configured in the current
borgmatic configuration file
* `label`: current repository label as configured in the current borgmatic
Sorry, another thing I think I mentioned on IRC.. What do you think of calling this
repository_label
instead of justlabel
?oups, right, my bad!
Step 1:
From your project repository, check out a new branch and test the changes.Step 2:
Merge the changes and update on Gitea.