-
Notifications
You must be signed in to change notification settings - Fork 8
Change github objects in set to only strings #67
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, one question, do we have env variables to allow mi-scheduler to schedule only some specific tasks?
for example having env variables that can deactivate/activate (0 not active, 1 active) one task if we don't want to schedule everything at the same time, or if we analyze these things in different clusters and don't want to perform double work?
SCHEDULE_GH_REPO_ANALYSIS
(in the future we can extend it to other SCHEDULE_GL_REPO_ANALYSIS
for GitLab)
SCHEDULE_KEBECHET_ANALYSIS
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment
@@ -48,9 +47,10 @@ class Schedule: | |||
def __init__(self, github: Github, organizations: List[str] = None, repositories: List[str] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just set the default for organizations and repositores to be []
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python is known to work unexpectedly here: if you use mutable as a default parameter, it can be modified later, which would affect all the other subsequent calls.
See here e.g.: https://web.archive.org/web/20200221224620/http://effbot.org/zone/default-values.htm
Therefore, for a better practice, I use None
and then check, instead of mutables as default (even though they are not modified in body).
@pacospace hmm, not sure if I understand correctly
Doesn't that do the limit setting in the openshift template (max. number of workflows allowed)?
if there are two |
My comment is related to schedule specific analysis like a semaphore. Imagine for example: cluster 1: SCHEDULE_GH_REPO_ANALYSIS=1, SCHEDULE_KEBECHET_ANALYSIS=0 cluster 2: SCHEDULE_GH_REPO_ANALYSIS=0, SCHEDULE_KEBECHET_ANALYSIS=1 See for example what we do for graph-refresh-job: https://github.com/thoth-station/graph-refresh-job/blob/d090fada6ba13ee212efc5729bf51bd3c45ba532/producer.py#L63 |
@pacospace yes, that's a good idea :) Issue created |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: xtuchyna The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Related Issues and Dependencies
Quick fix for recent PR #58 (PyGithub objects do not support hashing -> mentioned it here PyGithub/PyGithub#1826 ).