python-discord / infra

Infrastructure for Python Discord
https://docs.pydis.wtf
MIT License
12 stars 4 forks source link

Immortalizing GitHub discussions by copying them into the Git repository #459

Open jchristgit opened 1 month ago

jchristgit commented 1 month ago

As a biological organism with limited lifespan I want to retain all GitHub issue and pull request comments as part of the Git source code tree such that my successors can benefit from reading the musings of Joe William Banks IV on changes submitted by us to the repository.

Put more formally, I propose that we store our code discussions in Git using Git Notes. I think this is a smart idea with no bad impact on tooling.

I think a simple implementation could use the gh CLI to page through all pull requests and attach the comments of the pull requests on the respective merge commit, if no notes are already present on the commit. This would allow people to browse the notes offline. Bonus points if we could run it in CI somehow - I am sure that Joe has some smart idea for implementing it.

MarkKoz commented 3 weeks ago

Wow, Git has a never ending set of features! Thanks for sharing - I'm going to save that article and share it with my colleagues next week 😁. The peripheral content on GitHub adds valuable context, and it should be just as available as the commits and their messages. I appreciate you brining this up to the team.

Look. You can just say what needs to be said out loud. Online services are not being held accountable, and have shown disregard for preservation of user data, the internet, and its history. It seems like every week I read about another service shutting down; it's a modern tragedy! I'm on the same wavelength here looking out for our successors and reducing our reliance on these services, or at least creating contingencies. With how things have been going, I suspect our future selves will be thanking ourselves, let alone our successors.

Let's further explore the idea of running this in CI. It should be part of the acceptance criteria, but I'm also open to making incremental changes and getting there eventually. Running it manually will be prone to human error i.e. forgetfulness!

Thinking about the user experience, the bots may clutter up the notes in the logs; some of those comments can be quite long! Are there any bots or specific comments we'd like to omit from the record?

shtlrs commented 3 weeks ago

Why not store these on the filesystem, like this

.
└── gh_discussions/
    ├── issues/
    │   └── 2.md
    └── pull_requests/
        └── 19.md

These would trigger upon closing an issue/pr, and we'd have a workflow that extracts that juice, and submits a PR to add that or whatever.

jchristgit commented 3 weeks ago

Bella,

this also is not a bad idea. I guess the question then would be if you could still associate with commits or not.

One nice thing about git notes is that they are out of your way until you explicitly ask for them. Kind of like King Arthur.

jchristgit commented 3 weeks ago

That said, we could deploy a shell script on lovelace that would set up exactly that. /srv/github/python-discord/infra/.../. This is such a great idea, Bella. Such a wonderful idea. Such a brilliant idea. Bella, my warrior, Bella, my saviour, Bella, my propeller. You bring Python Discord DevOps forward.

shtlrs commented 3 weeks ago

How would you associate a series of comments to a particular commit?

We only fast forward here so would each discussion go to the tip of the branch?

jchristgit commented 1 day ago

How would you associate a series of comments to a particular commit?

Hard links or symlinks, I think.