-
Notifications
You must be signed in to change notification settings - Fork 18
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
workers: revision worker implementation #224
base: main
Are you sure you want to change the base?
Conversation
61a474e
to
306ca99
Compare
landoapi/workers/revision_worker.py
Outdated
try: | ||
warnings, errors = self.process(revision) | ||
except Exception as e: | ||
logger.info(f"Exception encountered while processing {revision}") | ||
revision.status = RS.PROBLEM | ||
revision.update_data(error="".join(e.args)) | ||
logger.exception(e) | ||
db.session.commit() | ||
continue |
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.
I think we should catch a different exception 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.
I will look into this one.
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.
A few more comments, questions etc.
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.
Please don't use single letter variable names.
landoapi/workers/revision_worker.py
Outdated
statuses = statuses or [ | ||
"draft", | ||
"needs-review", | ||
"accepted", | ||
"published", | ||
"changes-planned", | ||
] |
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.
What is the significance of this list as the default? If you could give this a :sort
too that would be great.
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.
It limits how many revisions we are synchronizing based on those that we need. The list will probably be tweaked in the future (e.g., maybe we don't sync drafts, or changes-planned, since those won't be landable anyway.)
c1be7fe
to
47de8d0
Compare
9fea31a
to
295c589
Compare
bd0c611
to
c3ec081
Compare
fcfd98b
to
30b64e9
Compare
0c15645
to
e093d5f
Compare
3225339
to
8e73e5a
Compare
00ba1c3
to
f3ededa
Compare
0e58aeb
to
18abe99
Compare
0fb50f6
to
5240202
Compare
for r in revision.predecessors + [revision]: | ||
try: | ||
hgrepo.apply_patch(io.BytesIO(r.patch_bytes)) | ||
except Exception as e: |
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.
See this comment.
NOTE: original branch name references the wrong bug. WIP DO NOT MERGE - implement base RevisionWorker (bug 1788728) - implement Supervisor worker (bug 1835861) - implement Processor worker (bug 1835862) - add repo.use_revision_worker feature flag (bug 1788732) - add main worker flag and capacity/throttle flags - add method to parse diff and list affected files <******* - add test coverage for revision_worker.py - add new start/stop commands to manage workers - add new flags to stop workers gracefully (*_WORKER_STOPPED) - refactor dependency and stack fetching and parsing using networkx <******** - rename old command lando-cli landing-worker to lando-cli start-landing-worker TODO: - detect stack change on page load - add tests for new warnings
5240202
to
dd677b6
Compare
NOTE: original branch name references the wrong bug.
WIP DO NOT MERGE
TODO: