resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Allow overriding "default-command" in profile

Open jkellerer opened this issue 3 years ago • 5 comments

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

jkellerer avatar Aug 13 '21 19:08 jkellerer

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

sonarqubecloud[bot] avatar Aug 13 '21 19:08 sonarqubecloud[bot]

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%) :arrow_down:

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.

codecov[bot] avatar Aug 13 '21 19:08 codecov[bot]

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

creativeprojects avatar Aug 22 '21 18:08 creativeprojects

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 avatar Aug 22 '21 19:08 jkellerer

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

sonarqubecloud[bot] avatar Sep 29 '21 17:09 sonarqubecloud[bot]