Skip to content

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.

3 participants