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

Add mechanism to execute setup steps before the first check run #4713

Merged
merged 2 commits into from
Oct 9, 2019

Conversation

ofek
Copy link
Contributor

@ofek ofek commented Oct 9, 2019

Motivation

We need a way to run things after the check_id is set by the Agent, such as submitting configuration metadata

@therve
Copy link
Contributor

therve commented Oct 9, 2019

That works, but about having a check_initializations method that we call once, with a flag set after it's called?

@ofek
Copy link
Contributor Author

ofek commented Oct 9, 2019

@therve The thing is there could be multiple such functions

@therve
Copy link
Contributor

therve commented Oct 9, 2019

@therve The thing is there could be multiple such functions

Sure, just call them from the check_initialization method?

initialization()
except Exception:
self.check_initializations.appendleft(initialization)
raise
Copy link
Member

@AlexandreYang AlexandreYang Oct 9, 2019

Choose a reason for hiding this comment

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

Seems this would have a similar effect, if I'm not missing something.

            while self.check_initializations:
                self.check_initializations[0]()
                self.check_initializations.pop(0)

@ofek
Copy link
Contributor Author

ofek commented Oct 9, 2019

@therve That means users/we would have to override that method, call super, then finally add the real logic. The current way allows us to have appropriately named functions that do exactly one thing and just append it to check_initializations.

@ofek ofek merged commit 168b34e into master Oct 9, 2019
@ofek ofek deleted the ofek/init branch October 9, 2019 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants