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

schedule: added unified schedule config struct #333

Merged
merged 5 commits into from
Mar 13, 2024

Conversation

jkellerer
Copy link
Collaborator

@jkellerer jkellerer commented Mar 3, 2024

Draft for schedule structs discussed in #80

# defaults in global section
global:
  systemd-drop-in-files:
    - "default-drop-in.conf"

  schedule-defaults:
    log: /path/to/default-schedule.log
    lock-wait: 60m

# inline or schedule structure type config in profile command sections
default:
  systemd-drop-in-files:
    - "profile-operrides.conf"

  # inline
  check:
    schedule:
      - weekly
    schedule-log: /path/to/check.log

  # schedule structure
  backup:
    schedule:
      at: "daily"
      log: /path/to/backup-schedule.log
      lock-wait: 30m

.. and finally group support (in this PR, it is config only. Also needs updates to scheduling (partially done in #290), coming later):

version = 2

groups:
  all:
    profiles: "*"
    schedules:
      backup:
        at: "daily"
        log: /path/to/backup-schedule.log
        lock-wait: 30m

Copy link

codecov bot commented Mar 3, 2024

Codecov Report

Attention: Patch coverage is 90.38902% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 70.50%. Comparing base (5fad1cb) to head (9a46c4c).

Files Patch % Lines
commands.go 33.33% 14 Missing ⚠️
config/mocks/PropertyInfo.go 48.00% 10 Missing and 3 partials ⚠️
config/config.go 79.41% 4 Missing and 3 partials ⚠️
config/jsonschema/schema.go 84.21% 1 Missing and 2 partials ⚠️
config/schedule.go 98.49% 2 Missing and 1 partial ⚠️
config/profile.go 92.59% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #333      +/-   ##
==========================================
+ Coverage   69.96%   70.50%   +0.54%     
==========================================
  Files         118      119       +1     
  Lines       11923    12176     +253     
==========================================
+ Hits         8341     8584     +243     
- Misses       3193     3196       +3     
- Partials      389      396       +7     
Flag Coverage Δ
unittests 70.50% <90.39%> (+0.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkellerer jkellerer force-pushed the ft/unified-schedule branch 2 times, most recently from 39e0e32 to 9a46c4c Compare March 9, 2024 21:24
@jkellerer jkellerer marked this pull request as ready for review March 10, 2024 14:52
@jkellerer
Copy link
Collaborator Author

@creativeprojects , think it is ready now. had it running on one of my machines and schedules work like before (had them recreated to use run-schedule).

@creativeprojects
Copy link
Owner

creativeprojects commented Mar 10, 2024

I looked at the MR and so far it all looks good to me.
I'm going to play with it on some of my configs and see how it goes 👍🏻

Oh BTW I forgot to mention I think we have no way of displaying a group configuration: the <profile>.show command only works with profiles 🤔 we could add the feature later though

@jkellerer
Copy link
Collaborator Author

Thanks for checking!

Copy link
Owner

@creativeprojects creativeprojects left a comment

Choose a reason for hiding this comment

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

It works fine 😛

Thank you for the great work 😉

I think we can merge it and I'll install it on more instances for good measure

@jkellerer jkellerer merged commit 4255868 into creativeprojects:master Mar 13, 2024
7 checks passed
@jkellerer jkellerer deleted the ft/unified-schedule branch March 13, 2024 08:06
@jkellerer
Copy link
Collaborator Author

Had already began refactoring #290 to allow scheduling groups. That is the only remaining part.

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.

None yet

2 participants