Repository navigation
Conversation
|
Thanks, good catch on temporary private forks. Supporting them shouldn't change how normal repositories are backed up unless there's a strong reason to, so a few things could do with adjusting. The main one is the PR comment format. Switching every repository to GraphQL changes the saved structure of On tests: 10 existing tests fail with The milestones/labels/releases 404 handling looks good. |
The reason is not making PR comment data structure be dependent on whether it was made in a temporary private fork or not (or more specifically, whether the normal issue comments endpoint 404s or not).
If you think it's important to keep this structure, it would be possible to map the fields out to their REST API equivalents. I'm not sure whether that's an acceptable approach for you.
Hmm, I guess incremental runs are going to be problematic, if the structure is now changed... If the above suggestion of mapping things out to old fields is acceptable then that would make things easier.
Hmm, I was under the impression that the token is required for the tool to run anyway. Is that not the case?
I could but then the tools reading the backups could encounter both formats, making things less consistent (unless the above suggestion of mapping out fields is acceptable). I'm not sure that's such a good idea.
I simply forgot to update the test data to include the
I can add that once we're clear on the other conversation points. Btw, you don't seem to be a maintainer or collaborator based on your badge - am I right in assuming that your feedback isn't necessarily going to be consistent with what the repo owner will want me to do in order to accept the contribution? |
One more thing worth noting is that the formats wouldn't be mixed within a single PR as comments are fetched from scratch every time a pull request is updated ("is due for repository checkpoint"). Between different PRs, however, the structures of |
|
@Iamrodos any other comments before I run tests? |
|
@Jackenmen thanks for the updates, and for the patience. You're right that I'm not a maintainer, just another contributor who helps out with reviews. So take this as a steer, whether it merges is Jose's call. You're also right on the token, sorry for the noise on that one. My main concern is people whose backups work today. Nothing has changed for them, yet after this their PR comments would be saved in a different format. I take your point that falling back on a 404 means two formats, but that only touches temporary forks, which have no backup of these comments at all today. So I'd try REST first and use your GraphQL query only on a 404. Not as clean as one format, I know. The joys of a tool that has followed GitHub's API around for years. Jose is about to run CI, so it's worth running the tests and flake8 locally first, the tests pass for me but flake8 flags an unused This is a real gap you've found and the rest of the change looks good to me, so it feels close. Thanks for sticking with it. @josegonzalez that's all from me, feel free to weigh in if you'd steer this differently. |
|
I've been treating @Iamrodos as the maintainer of the project:
Anyways, I'll run tests, but basically whatever @Iamrodos says is cannon to me :) |
|
In @Iamrodos we trust (just I don't want him to merge a PR that leaks my user-wide actions secrets 😂). |
|
Alright, I'll address his review within the next few days.
@Iamrodos what do you think about my suggestion of mapping out GraphQL fields to REST API ones to avoid temporary private forks using a different format? Worth doing for better consistency or not? |
|
Thanks. I'd leave them unmapped. As a backup tool it's better to stay as close as we can to what GitHub provides than to translate it. A mapping is also one more thing to maintain as either API changes, and it can turn into a rabbit hole, the user info isn't the same shape and neither are the reactions. I'd rather leave that to whoever reads the backup than do it ahead of time for them. |
Fixes #547
The biggest change involves fetching PR comments - per https://github.com/orgs/community/discussions/213137
/repos/{owner}/{repo}/issues/{issue_number}/commentsdoes not work on temporary private forks. Instead, I switched comment retrieval for pull requests to use a GraphQL query. The same data should be present in both old REST API and new GraphQL API implementation but the way it's structured into fields is not the same for some information. I used the implementation for discussion comments as a starting point so let me know, if there's any other field from IssueComment that you think is worth including.