Skip to content

Notebook to generate release notes#258

Merged
nrichers merged 34 commits intomainfrom
noosheenvazinkhoo/sc-5455/notebook-for-release-notes
Aug 15, 2024
Merged

Notebook to generate release notes#258
nrichers merged 34 commits intomainfrom
noosheenvazinkhoo/sc-5455/notebook-for-release-notes

Conversation

@noosheenv
Copy link
Copy Markdown
Contributor

Internal Notes for Reviewers

I restructured the generate-release-notes.py script to use objects when possible for better data organization and code modularity. See generate-release-objects.py inside ~/release-scripts for the updated version. I will delete the old scripts inside of site/scripts when everything is approved.

The notebook is called generate-release-notes.ipynb inside of ~/release-scripts. It imports functions from generate-release-objects.py to help with abstraction and keeping things simple.

For aspects of code that should be modified, I overwrote the function within the notebook so that you can change stuff like the path to your .env file, the OpenAI editing prompt, and more. By default, everything should work, so it's fine to not change anything too.

Also, I added docstrings, or function specifications to all functions. I did it for proper programming practice and to make the code more readable for open source stuff.

Since this is an internal notebook, the little instructions around the code blocks can be minimal, but right now my instructions are toooooo minimal. I will keep working on that, but in the meantime, feel free to test the notebook and offer suggestions!

External Release Notes

@noosheenv noosheenv added the internal Not to be externalized in the release notes label Jul 29, 2024
@noosheenv noosheenv self-assigned this Jul 29, 2024
@noosheenv noosheenv marked this pull request as draft July 31, 2024 16:50
@noosheenv
Copy link
Copy Markdown
Contributor Author

I am working on implementing a git diff code explain using OpenAI, marking PR as draft while that's in progress!

@noosheenv
Copy link
Copy Markdown
Contributor Author

The git diff is no bueno!! Script has git diff related functions, will get deleted EOD today (after showing Nik at Community Catchup)

@noosheenv noosheenv marked this pull request as ready for review August 6, 2024 20:39
Copy link
Copy Markdown
Collaborator

@nrichers nrichers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noosheenv great work! 🥇 I left some initial comments for you to address and will retest afterwards.

Note that the section "Extract PRs from each URL" runs for a long time and never actually finished for me while testing.

@noosheenv
Copy link
Copy Markdown
Contributor Author

I implemented functionality to use the github-actions summary bot! It's looking pretty good so far. The main plus is that it works!!

Here's a sneak peek of what it can do:
image

If you want to try this yourself, run the first code block (all the imports), then run the second code cell under "Try automated GitHub PR summary (or cmd+f: RUN FIRST CODE BLOCK (IMPORTS), THEN THIS ONE TO TRY :D DON'T NEED TO RUN ANY OTHER BLOCKS.)

If you want to try other PRs, you can replace the repo_name and pr_number parameters to a different one that has a bot comment already. Right now, it's set to validmind/frontend and 888.

For now, I'm going to keep fiddling with the prompt and see if there's a way to combine/compare this summary with the old one to preserve images and links.

@noosheenv noosheenv requested a review from nrichers August 13, 2024 16:15
Copy link
Copy Markdown
Collaborator

@nrichers nrichers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚀 🚀 🚀 LGTM! (Looks GREAT to me!) I retestest your notebook with some release URLs and every step works as expected — the only thing I was not able to test as-is is the automatic summaries but you had demoed that these work.

One minor comment for myself for the future: we can likely condense some of the cell output by reducing the amount of whitespace we output. But the output now contains all the info you might want which is great.

Very nice work, @noosheenv! I look forward to using this for our next release notes.

@validbeck
Copy link
Copy Markdown
Collaborator

@nrichers I'm not sure how to resolve these, my attempts did not work! Seems like it's still checking against the OLD filename with the uppercasing instead of honouring the new filename without the uppercasing even when I rename everything ughhh 💀

@nrichers
Copy link
Copy Markdown
Collaborator

@nrichers I'm not sure how to resolve these, my attempts did not work! Seems like it's still checking against the OLD filename with the uppercasing instead of honouring the new filename without the uppercasing even when I rename everything ughhh 💀

@validbeck this branch had a legitimate merge conflict with one of the notebooks (the source, not the output). Fixed that, added all the files, and continued the merge, followed by render. Looks fine now, previously problematic paths included.

Note that the PR explanation step is failing due to excessive length, going to merge as not relevant to the technical changes:

openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid 'messages[0].content': string too long. Expected a string with maximum length 1048576, but got a string with length 4988725 instead.", 'type': 'invalid_request_error', 'param': 'messages[0].content', 'code': 'string_above_max_length'}}

@nrichers nrichers merged commit 288b4b4 into main Aug 15, 2024
@nrichers nrichers deleted the noosheenvazinkhoo/sc-5455/notebook-for-release-notes branch August 15, 2024 17:34
@validbeck
Copy link
Copy Markdown
Collaborator

this branch had a legitimate merge conflict with one of the notebooks (the source, not the output). Fixed that, added all the files, and continued the merge, followed by render. Looks fine now, previously problematic paths included.

Doesn't make get-source override the existing notebooks? Bit confused as to how the source had a conflict 🤔

@nrichers
Copy link
Copy Markdown
Collaborator

Doesn't make get-source override the existing notebooks? Bit confused as to how the source had a conflict 🤔

Yes, it does, and one of those source notebooks had a merge conflict. It's like any other source file that has a merge conflict, you need to actually resolve it. Kinda rare for content we merge in from other repos, but it can happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal Not to be externalized in the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants