-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Automated Release Notes #2306
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
Merged
Merged
Automated Release Notes #2306
Changes from 57 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
59f081d
add changelog file
aliabd f65fec0
Check release notes
freddyaboulton 8d45ab6
Fix syntax
freddyaboulton 0577283
Fix path to changelog
freddyaboulton 30d504e
Use changelog
freddyaboulton 625ba10
Add to changelog
freddyaboulton 0f97595
Add comment
freddyaboulton cae9762
Test comment
freddyaboulton 75dc120
Use txt file for comment body
freddyaboulton cd04cd9
Fix for multiline
freddyaboulton 12bfd51
rendering on website, changes to changelog
aliabd 19b8079
merge
aliabd b83b8db
Don't use txt file
freddyaboulton 22317b7
Fix pr number
freddyaboulton a0755be
merge
aliabd 199d594
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
aliabd 6a50122
Split it up into two
freddyaboulton a3a4c39
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
freddyaboulton e0d92ba
Test fail
freddyaboulton 982a322
Follow example
freddyaboulton 28c0b48
Fix syntax
freddyaboulton f9e36f8
Delete quotes
freddyaboulton 5fee1fe
Add syntax
freddyaboulton 2ddd303
Fix names
freddyaboulton ec9324f
Fix syntax
freddyaboulton 48ac3e1
Modify pr template instead and remove backticks
freddyaboulton 7fe3bab
Check word
freddyaboulton 66c947d
Merge branch 'main' into 1718-auto-release-notes
aliabd 97aa1a8
changelog file fixes
aliabd 98cd34f
add 3.4 release notes to changelog
aliabd 0c4584a
add navigation
aliabd ee627b6
replace pr tag and @ usernames with links
aliabd c174d55
remove empty/unused sections from rendering
aliabd 757deef
fix format of 3.4 notes
aliabd da1e356
Merge branch 'main' into 1718-auto-release-notes
aliabd 17a6127
add releases dir and 3.0-2 notes
aliabd d4cfd4a
render from releases dir
aliabd df5c89a
remove changelog file
aliabd 4a838b5
Fix RN check
freddyaboulton 21b7dfc
Merge branch 'main' into 1718-auto-release-notes
freddyaboulton 3b67053
Fix path
freddyaboulton 39f37e8
upcoming release title
aliabd 7d01e40
switch to periods from dashes
aliabd 767a602
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
aliabd 8a710b6
add link to changelog in docs
aliabd 8ffaba1
Add script modify files
freddyaboulton b69f57d
Modify changelog
freddyaboulton dbdaf32
change to release history
aliabd 2bbba65
merge
aliabd b68bf52
modify gh actions
freddyaboulton e211f07
Fix syntax
freddyaboulton e48f26d
Skip draft releases during reformatting
freddyaboulton 5c1a59d
Merge branch 'main' into 1718-auto-release-notes
aliabd c5976a0
skip template when rendering
aliabd 927ce2a
modify upcoming.md to reflect real changes
aliabd fbc3a64
replace links with pr tag
aliabd 968b823
Add automated release notes as a new feature in upcoming
aliabd f818873
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd 7110110
eUpdate website/homepage/src/style.css
aliabd 215801a
Misc fixes
freddyaboulton fa789e5
one file at root
aliabd f143403
Fix Changelog check
freddyaboulton a6e3811
Modify release notes format script
freddyaboulton 03c1b00
Fix format script + release notes
freddyaboulton 55ac9bd
Add to contributing
freddyaboulton 668c4e9
Undo change to release notes from testing script
freddyaboulton 045ea76
Add pr 2373 to rl
freddyaboulton b5010e0
Modify file path
freddyaboulton dda07d9
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd cf939c2
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: check-changelog | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, labeled, unlabeled] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this rerun if a PR is updated? i.e. if someone pushes more commits to an open PR?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes! |
||
|
|
||
| jobs: | ||
| check-changelog-updated: | ||
| name: Check CHANGELOG file | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains( github.event.pull_request.labels.*.name, 'no-changelog-update') }} | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} | ||
| repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
| - name: Release notes added | ||
| run: | | ||
| cat website/releases/UPCOMING.md | grep -w ":pr:${{ github.event.number }}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import shutil | ||
| import pathlib | ||
| import argparse | ||
|
|
||
| current_dir = (pathlib.Path(__file__).parent / "..").resolve() | ||
|
|
||
|
|
||
| def format_release_notes(latest_version: str): | ||
| shutil.copy(current_dir / "website" / "releases" / "UPCOMING.md", | ||
|
abidlabs marked this conversation as resolved.
Outdated
|
||
| current_dir / "website" / "releases" / f"{latest_version}.md") | ||
| with open(current_dir / "website" / "releases" / f"{latest_version}.md", "r") as latest: | ||
| lines = latest.readlines() | ||
| with open(current_dir / "website" / "releases" / f"{latest_version}.md", "w") as latest: | ||
| lines[0] = latest_version.replace("v", "# Version ") + "\n" | ||
| latest.writelines(lines) | ||
| shutil.copy(current_dir / "website" / "releases" / "TEMPLATE.md", | ||
| current_dir / "website" / "releases" / "UPCOMING.md") | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| parser = argparse.ArgumentParser(description="Upload a demo to a space") | ||
| parser.add_argument("latest_version", type=str, help="Name of demo to upload") | ||
| args = parser.parse_args() | ||
| format_release_notes(args.latest_version) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <h1 id="upcoming-release">Upcoming Release</h1> | ||
|
|
||
| <h2 id="bug-fixes">Bug Fixes:</h2> | ||
|
|
||
| <ol> | ||
| <li>Fix typo in guide image path by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2357'>https://github.com/gradio-app/gradio/pull/2357</a></li> | ||
| <li>Raise error if Blocks has duplicate component with same IDs by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2359'>https://github.com/gradio-app/gradio/pull/2359</a></li> | ||
| <li>Catch the permission exception on the audio component by <a rel="noopener" target="_blank" href='https://github.com/Ian-GL'>@Ian-GL</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2330'>https://github.com/gradio-app/gradio/pull/2330</a></li> | ||
| <li>Fix image<em>classifier</em>interface_load demo by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2365'>https://github.com/gradio-app/gradio/pull/2365</a></li> | ||
| </ol> | ||
|
|
||
| <h2 id="documentation-changes">Documentation Changes:</h2> | ||
|
|
||
| <ol> | ||
| <li><p>New Guide: Connecting to a Database 🗄️</p> | ||
|
|
||
| <p>A new guide by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> that explains how you can use Gradio to connect your app to a database. Read more <a rel="noopener" target="_blank" href="https://gradio.app/connecting_to_a_database/">here</a>.</p></li> | ||
| <li><p>New Guide: Running Background Tasks 🥷</p> | ||
|
|
||
| <p>A new guide by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> that explains how you can run background tasks from your gradio app. Read more <a rel="noopener" target="_blank" href="https://gradio.app/running_background_tasks/">here</a>.</p></li> | ||
| <li><p>Small fixes to docs for <code>Image</code> component by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2372'>https://github.com/gradio-app/gradio/pull/2372</a></p></li> | ||
| </ol> | ||
|
|
||
| <h2 id="full-changelog">Full Changelog:</h2> | ||
|
|
||
| <ul> | ||
| <li>Create a guide on how to connect an app to a database hosted on the cloud by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2341'>https://github.com/gradio-app/gradio/pull/2341</a></li> | ||
| <li>Removes <code>analytics</code> dependency by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2347'>https://github.com/gradio-app/gradio/pull/2347</a></li> | ||
| <li>Add guide on launching background tasks from your app by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2350'>https://github.com/gradio-app/gradio/pull/2350</a></li> | ||
| <li>Fix typo in guide image path by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2357'>https://github.com/gradio-app/gradio/pull/2357</a></li> | ||
| <li>Raise error if Blocks has duplicate component with same IDs by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2359'>https://github.com/gradio-app/gradio/pull/2359</a></li> | ||
| <li>Hotfix: fix version back to 3.4 by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2361'>https://github.com/gradio-app/gradio/pull/2361</a></li> | ||
| <li>Change version.txt to 3.4 instead of 3.4.0 by <a rel="noopener" target="_blank" href='https://github.com/aliabd'>@aliabd</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2363'>https://github.com/gradio-app/gradio/pull/2363</a></li> | ||
| <li>Catch the permission exception on the audio component by <a rel="noopener" target="_blank" href='https://github.com/Ian-GL'>@Ian-GL</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2330'>https://github.com/gradio-app/gradio/pull/2330</a></li> | ||
| <li>Fix image<em>classifier</em>interface_load demo by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2365'>https://github.com/gradio-app/gradio/pull/2365</a></li> | ||
| <li>Small fixes to docs for <code>Image</code> component by <a rel="noopener" target="_blank" href='https://github.com/abidlabs'>@abidlabs</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2372'>https://github.com/gradio-app/gradio/pull/2372</a></li> | ||
| <li>Automated Release Notes by <a rel="noopener" target="_blank" href='https://github.com/freddyaboulton'>@freddyaboulton</a> in <a rel="noopener" target="_blank" href='https://github.com/gradio-app/gradio/pull/2306'>https://github.com/gradio-app/gradio/pull/2306</a></li> | ||
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| import os | ||
| import markdown2 | ||
| import shutil | ||
| import re | ||
|
|
||
| DIR = os.path.dirname(__file__) | ||
| RELEASES_DIR = os.path.join(DIR, "..", "..", "..", "releases") | ||
|
|
||
| def render_md(version_filename): | ||
| with open(os.path.join(RELEASES_DIR, version_filename), "r") as change_file: | ||
| content = change_file.read() | ||
|
|
||
| # replace code blocks correctly | ||
| content = re.sub( | ||
| r"```([a-z]+)\n", | ||
| lambda x: f"<div class='codeblock'><pre><code class='lang-{x.group(1)}'>", | ||
| content, | ||
| ) | ||
| content = re.sub(r"```", "</code></pre></div>", content) | ||
|
|
||
| # replace pr tags with links | ||
| content = re.sub( | ||
| r"\:pr\:(\d[^\n ]*)", | ||
| lambda x: f"<a href='https://github.com/gradio-app/gradio/pull/{x.group(1)}'>https://github.com/gradio-app/gradio/pull/{x.group(1)}</a>", | ||
| content, | ||
| ) | ||
|
|
||
| # replace @ usernames with links | ||
| content = re.sub( | ||
| r"\@([^\n ]*)", | ||
| lambda x: f"<a href='https://github.com/{x.group(1)}'>@{x.group(1)}</a>", | ||
| content, | ||
| ) | ||
|
|
||
| # remove empty/unused sections | ||
| content = re.sub(r"## [\w^:\n ]*No changes to highlight.", "", content) | ||
|
|
||
| content_html = markdown2.markdown( | ||
| content, | ||
| extras=[ | ||
| "target-blank-links", | ||
| "header-ids", | ||
| "tables", | ||
| "fenced-code-blocks", | ||
| ], | ||
| ) | ||
|
|
||
| with open(os.path.join(DIR, f"{version_filename[:-3]}.html"), "w+") as temp_html: | ||
| temp_html.write(content_html) | ||
|
|
||
| versions = [] | ||
| for version_filename in os.listdir(RELEASES_DIR): | ||
| if version_filename == "TEMPLATE.md": | ||
| continue | ||
| render_md(version_filename) | ||
| versions.append(version_filename[:-3]) | ||
|
|
||
| versions.remove("UPCOMING") | ||
| versions.sort(reverse=True) | ||
| versions = ["UPCOMING"] + versions | ||
|
|
||
| def build(output_dir, jinja_env): | ||
| os.makedirs(output_dir, exist_ok=True) | ||
| template = jinja_env.get_template("changelog/parent_template.html") | ||
| output = template.render(versions=versions) | ||
| output_folder = os.path.join(output_dir, "changelog") | ||
| os.makedirs(output_folder) | ||
| output_file = os.path.join(output_folder, "index.html") | ||
| with open(output_file, "w") as index_html: | ||
| index_html.write(output) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| {% with title="Changelog", url="https://gradio.app/changelog", image="https://www.gradio.app/assets/img/meta-image.png", description="Gradio Changelog and Release Notes" %} | ||
| {% include "templates/meta.html" %} | ||
| {% endwith %} | ||
| <link rel="stylesheet" href="/style.css"> | ||
| <link rel="stylesheet" href="/assets/prism.css"> | ||
| </head> | ||
| <body> | ||
| {% include "templates/navbar.html" %} | ||
| <div class="container mx-auto px-4 flex gap-4 relative"> | ||
| <div class="side-navigation h-screen leading-relaxed sticky top-0 text-md overflow-y-auto overflow-x-hidden hidden lg:block rounded-t-xl bg-gradient-to-r from-white to-gray-50" | ||
| style="min-width: 18%"> | ||
| <div class="category-link my-2 font-semibold px-4 pt-2 text-ellipsis block" | ||
| style="max-width: 12rem"> | ||
| Version History | ||
| </div> | ||
| {% for version in versions %} | ||
| {% if version == "UPCOMING" %} | ||
| <a class="version-link {% if loop.first %}current-nav-link{% endif %} pb-1 -indent-2 ml-2 thin-link px-4 block overflow-hidden" | ||
| style="max-width: 12rem" | ||
| href="#UPCOMING-section">Upcoming Release</a> | ||
| {% else %} | ||
| <a class="version-link {% if loop.first %}current-nav-link{% endif %} pb-1 -indent-2 ml-2 thin-link px-4 block overflow-hidden" | ||
| style="max-width: 12rem" | ||
| href="#{{ version | replace('.','-') }}-section">{{ version }}</a> | ||
| {% endif %} | ||
| {% endfor %} | ||
| </div> | ||
| <div class="w-full"> | ||
| {% for version in versions %} | ||
| <div class="prose text-lg max-w-full" id="{{ version | replace('.','-') }}-section">{% include "changelog/%s.html" % version %}</div> | ||
| {% endfor %} | ||
| </div> | ||
| </div> | ||
| <script src="/assets/prism.js"></script> | ||
| <script>window.__gradio_mode__ = "website";</script> | ||
| <script type="module" src="/assets/index.js"></script> | ||
| {% include 'templates/footer.html' %} | ||
| <script>{% include 'templates/add_anchors.js' %}</script> | ||
| <script>{% include 'templates/add_copy.js' %}</script> | ||
| <script> | ||
| let mainNavLinks = document.querySelectorAll(".side-navigation a"); | ||
| window.addEventListener("scroll", event => { | ||
| let fromTop = window.scrollY; | ||
| mainNavLinks.forEach(link => { | ||
| let section = document.querySelector(link.hash); | ||
| if ( | ||
| section.offsetTop <= fromTop*1.01 && | ||
| section.offsetTop + section.offsetHeight > fromTop*1.01 | ||
| ) { | ||
| link.classList.add("current-nav-link"); | ||
| } else { | ||
| link.classList.remove("current-nav-link"); | ||
| } | ||
| }); | ||
| }); | ||
|
|
||
| </script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.