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

Allow to properly dump the multiples PRs #6

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Allow to properly dump the multiples PRs #6

merged 1 commit into from
Jan 8, 2024

Conversation

mpatou
Copy link
Contributor

@mpatou mpatou commented Jan 5, 2024

Summary

If there is more than one PRs open_prs is a list of dict and trying to
stringify it is not working too well:

Traceback (most recent call last):
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1542, in
main()
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1529, in main
args.func(stack, args)
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1042, in cmd_update
load_pr_info_for_forest(forest)
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 531, in load_pr_info_for_forest
b.load_pr_info()
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 303, in load_pr_info
self.pr_info, self.open_pr_info = get_pr_info(self.name)
File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 251, in get_pr_info
die("Branch {} has more than one open PR: {}", branch, ", ".join(open_prs))
TypeError: sequence item 0: expected str instance, dict found

## Test plan
Reran with the fix and got this instead:

2023-12-16 18:48:39,690 stacky ERROR: Branch master has more than one open PR: {'baseRefName': 'master', 'headRefName': 'master', 'id': 'PR_kwDOCQXGIM5CfHq6', 'mergeable': 'MERGEABLE', 'number': 303, 'state': 'OPEN', 'title': 'cc_library support resolve directive', 'url': 'https://github.com/stackb/rules_proto/pull/303'}, {'baseRefName': 'master', 'headRefName': 'master', 'id': 'PR_kwDOCQXGIM4x4YnZ', 'mergeable': 'CONFLICTING', 'number': 213, 'state': 'OPEN', 'title': 'fix: allow generated files to be in a subfolder', 'url': 'https://github.com/stackb/rules_proto/pull/213'}

Reviewers: tudor

Summary
If there is more than one PRs open_prs is a list of dict and trying to
stringify it is not working too well:

Traceback (most recent call last):
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1542, in <module>
    main()
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1529, in main
    args.func(stack, args)
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 1042, in cmd_update
    load_pr_info_for_forest(forest)
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 531, in load_pr_info_for_forest
    b.load_pr_info()
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 303, in load_pr_info
    self.pr_info, self.open_pr_info = get_pr_info(self.name)
  File "/data/home/mpatou/Rockset/rs/../rs2/scripts/stacky", line 251, in get_pr_info
    die("Branch {} has more than one open PR: {}", branch, ", ".join(open_prs))
TypeError: sequence item 0: expected str instance, dict found

Test plan
Reran with the fix and got this instead:
```
2023-12-16 18:48:39,690 stacky ERROR: Branch master has more than one open PR: {'baseRefName': 'master', 'headRefName': 'master', 'id': 'PR_kwDOCQXGIM5CfHq6', 'mergeable': 'MERGEABLE', 'number': 303, 'state': 'OPEN', 'title': 'cc_library support resolve directive', 'url': 'stackb/rules_proto#303'}, {'baseRefName': 'master', 'headRefName': 'master', 'id': 'PR_kwDOCQXGIM4x4YnZ', 'mergeable': 'CONFLICTING', 'number': 213, 'state': 'OPEN', 'title': 'fix: allow generated files to be in a subfolder', 'url': 'stackb/rules_proto#213'}
```

Reviewers: tudor
@mpatou mpatou requested a review from tudor January 5, 2024 19:40
@mpatou mpatou merged commit c137580 into master Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants