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

Allow overriding "default-command" in profile #64

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jkellerer
Copy link
Collaborator

Add "default-command" from global also to the profile sections.
This allows to create profiles (and group of such profiles) for special cases, e.g. like check or prune:

groups:
  prune-all: ["prune-repo1", ...]

prune-repo1:
  inherit: "repo1"
  default-command: "prune"
  prune:
    schedule: "daily"
...

The example above can be run with resticprofile -n prune-all

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.2% 0.2% Duplication

@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #64 (6308eeb) into master (245a440) will decrease coverage by 0.10%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
- Coverage   60.63%   60.52%   -0.11%     
==========================================
  Files          60       60              
  Lines        4623     4631       +8     
==========================================
  Hits         2803     2803              
- Misses       1621     1629       +8     
  Partials      199      199              
Impacted Files Coverage Δ
config/profile.go 91.25% <ø> (ø)
main.go 0.83% <0.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 245a440...6308eeb. Read the comment docs.

@jkellerer jkellerer mentioned this pull request Aug 13, 2021
5 tasks
@creativeprojects
Copy link
Owner

This is one way of doing it, while keeping the groups section the way it is, which is fine.

Also, I have been thinking about the groups configuration for a while, and I clearly overlooked it when I did it.
At some point I would like to change it so we can configure options inside a group, the most obvious would be to be able to schedule a group.

In which case, default command would fit nicely in a group configuration.

Now I don't mind adding a default command per profile though

@jkellerer
Copy link
Collaborator Author

Having "default-command" in a group is also a good thing. Priority wise it's just a question what comes first when we have gobal, group and profile. When it is added to groups as well it is probably best to prioritise group, otherwise profiles with a "default-command" cannot be added to groups that are built for scheduling a particular purpose.

@jkellerer jkellerer force-pushed the ft-default-command-in-profile branch from bb254ea to 6308eeb Compare September 29, 2021 17:56
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

2 participants