-
Notifications
You must be signed in to change notification settings - Fork 6
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
Gracefully Handle Missing Permissions #11
Conversation
netloc=f"{username}:{password}@{parts.netloc}" | ||
).geturl() | ||
logging.info("Assigning credentials for push.") | ||
run([GIT, "remote", "set-url", "origin", cred_url], cwd=repo.full_name) |
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.
At some point we should replace these git commands with GitPython.
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 #12, which I just created.
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.
@felddy Do you remember why you didn't leverage that when you first wrote this?
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.
Probably didn't know about it yet. Not a technical reason.
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'd like those logging.warning("ERROR!")
messages to be made consistent. Otherwise this looks good to me.
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.
Looks good. Thanks for fixing my omissions. See my two ideas about warnings.
src/lineage/entrypoint.py
Outdated
body = pystache.render(clean_template, template_data) | ||
create_pull_request( | ||
repo, pr_branch_name, local_branch, title, body, draft=False | ||
logging.info( |
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.
Should we make this a warning?
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.
Let's make it a warning, but make sure the warning string starts with "ERROR!'
src/lineage/entrypoint.py
Outdated
create_pull_request( | ||
repo, pr_branch_name, local_branch, title, body, draft=False | ||
logging.info( | ||
"Not creating a new pull request since the branch already existed." | ||
) | ||
else: | ||
logging.info( |
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.
Warning?
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.
Strong work!
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.
Nice fixes in here 🚀
🗣 Description
This PR adds functionality to gracefully handle a previously fatal case of missing permissions. This should resolve #4 . It also adds a status badge to the README for the
lineage_scan
workflow.💭 Motivation and Context
We have run into the issue where a repository does not have the correct permissions configured, and this causes the Lineage workflow to fail. If unnoticed, it can go on for an extended period of time (the latest was four weeks). When this happens, the workflow will only process repositories until it hits the problem repository. Anything in the search results after that will not be updated.
The new badge allows an at-a-glance check for the last
lineage_scan
workflow run.🧪 Testing
Automated tests pass.
🚥 Types of Changes
✅ Checklist