-
Notifications
You must be signed in to change notification settings - Fork 1
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
PRs not created after successful message #2
Comments
Behavior is unexpected, but not exactly incorrect or erroneous? Here is the relevant line for when it would retrieve a branch created by someone else, but with the desired name:
Here is the relevant line for when it would retrieve a PR created by someone else:
My test PR on the same repository is likely being retrieved due to the name being the same as the one the program was going to create. |
Now, the question is going to be: How do we want this to be solved? We likely don't want potentially hundreds of duplicate branches and PRs being created when the program is run on different accounts, but we also want to be able to test it without creating or involving more repositories. I can add a clause to the PR if statement that checks if the user is the author: # get the current session user
user = get_user()
for pr in prs:
if pr.head.ref == PR_branch.name and pr.user.login == user.login:
print(f"PR already exists: {pr.html_url}")
pr.edit(title=PR_title, body=PR_body)
return pr However, given the potential duplication issue, we can use a command line argument to have this behavior be adjustable, like so: # get the current session user
user = get_user()
for pr in prs:
if pr.head.ref == PR_branch.name:
if GLOBAL_FLAGS["require-distinct"] and not pr.user.login == user.login:
continue
print(f"PR already exists: {pr.html_url}")
pr.edit(title=PR_title, body=PR_body)
return pr The default value for the flag would likely be false, and require someone to specifically include the Additionally, assuming we want distinct branches and PRs, we could take the route of changing the naming scheme: branch_name = "repository_management_bot/template_compliance" -> user = get_user()
branch_name = f"repository_management_bot/{user.login}/template_compliance" (This, or some other method to differentiate the name, would likely be required to facilitate distinct branches, forks, and PRs) What are your thoughts/requirements? @benlee0423 |
Regardless of the route we take, I believe we need to include print statements in the decision tree, so the user is aware of when steps are skipped. Before anything else, I will handle that, so we have the option of verifying that my understanding of the problem is correct. |
Problems with logging and some edge cases mitigated with commit cccdee7. |
@chp2001
The issue here is it said |
Short description explaining the high-level reason for the new issue.
Current behavior
Commands run
Messages below after the last command.
Expected behavior
Steps to replicate behavior (include URLs)
Explained in the behavior
Screenshots
The text was updated successfully, but these errors were encountered: