Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
59f081d
add changelog file
aliabd Sep 20, 2022
f65fec0
Check release notes
freddyaboulton Sep 20, 2022
8d45ab6
Fix syntax
freddyaboulton Sep 20, 2022
0577283
Fix path to changelog
freddyaboulton Sep 20, 2022
30d504e
Use changelog
freddyaboulton Sep 20, 2022
625ba10
Add to changelog
freddyaboulton Sep 20, 2022
0f97595
Add comment
freddyaboulton Sep 20, 2022
cae9762
Test comment
freddyaboulton Sep 20, 2022
75dc120
Use txt file for comment body
freddyaboulton Sep 20, 2022
cd04cd9
Fix for multiline
freddyaboulton Sep 20, 2022
12bfd51
rendering on website, changes to changelog
aliabd Sep 20, 2022
19b8079
merge
aliabd Sep 20, 2022
b83b8db
Don't use txt file
freddyaboulton Sep 20, 2022
22317b7
Fix pr number
freddyaboulton Sep 20, 2022
a0755be
merge
aliabd Sep 20, 2022
199d594
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
aliabd Sep 20, 2022
6a50122
Split it up into two
freddyaboulton Sep 20, 2022
a3a4c39
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
freddyaboulton Sep 20, 2022
e0d92ba
Test fail
freddyaboulton Sep 20, 2022
982a322
Follow example
freddyaboulton Sep 20, 2022
28c0b48
Fix syntax
freddyaboulton Sep 20, 2022
f9e36f8
Delete quotes
freddyaboulton Sep 20, 2022
5fee1fe
Add syntax
freddyaboulton Sep 20, 2022
2ddd303
Fix names
freddyaboulton Sep 20, 2022
ec9324f
Fix syntax
freddyaboulton Sep 20, 2022
48ac3e1
Modify pr template instead and remove backticks
freddyaboulton Sep 21, 2022
7fe3bab
Check word
freddyaboulton Sep 21, 2022
66c947d
Merge branch 'main' into 1718-auto-release-notes
aliabd Sep 27, 2022
97aa1a8
changelog file fixes
aliabd Sep 27, 2022
98cd34f
add 3.4 release notes to changelog
aliabd Sep 27, 2022
0c4584a
add navigation
aliabd Sep 28, 2022
ee627b6
replace pr tag and @ usernames with links
aliabd Sep 28, 2022
c174d55
remove empty/unused sections from rendering
aliabd Sep 28, 2022
757deef
fix format of 3.4 notes
aliabd Sep 28, 2022
da1e356
Merge branch 'main' into 1718-auto-release-notes
aliabd Sep 29, 2022
17a6127
add releases dir and 3.0-2 notes
aliabd Sep 29, 2022
d4cfd4a
render from releases dir
aliabd Sep 29, 2022
df5c89a
remove changelog file
aliabd Sep 29, 2022
4a838b5
Fix RN check
freddyaboulton Sep 29, 2022
21b7dfc
Merge branch 'main' into 1718-auto-release-notes
freddyaboulton Sep 29, 2022
3b67053
Fix path
freddyaboulton Sep 29, 2022
39f37e8
upcoming release title
aliabd Sep 29, 2022
7d01e40
switch to periods from dashes
aliabd Sep 29, 2022
767a602
Merge branch '1718-auto-release-notes' of github.com:gradio-app/gradi…
aliabd Sep 29, 2022
8a710b6
add link to changelog in docs
aliabd Sep 29, 2022
8ffaba1
Add script modify files
freddyaboulton Sep 29, 2022
b69f57d
Modify changelog
freddyaboulton Sep 29, 2022
dbdaf32
change to release history
aliabd Sep 29, 2022
2bbba65
merge
aliabd Sep 29, 2022
b68bf52
modify gh actions
freddyaboulton Sep 29, 2022
e211f07
Fix syntax
freddyaboulton Sep 29, 2022
e48f26d
Skip draft releases during reformatting
freddyaboulton Sep 29, 2022
5c1a59d
Merge branch 'main' into 1718-auto-release-notes
aliabd Sep 29, 2022
c5976a0
skip template when rendering
aliabd Sep 29, 2022
927ce2a
modify upcoming.md to reflect real changes
aliabd Sep 29, 2022
fbc3a64
replace links with pr tag
aliabd Sep 29, 2022
968b823
Add automated release notes as a new feature in upcoming
aliabd Sep 29, 2022
f818873
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd Sep 30, 2022
7110110
eUpdate website/homepage/src/style.css
aliabd Sep 30, 2022
215801a
Misc fixes
freddyaboulton Sep 30, 2022
fa789e5
one file at root
aliabd Sep 30, 2022
f143403
Fix Changelog check
freddyaboulton Oct 3, 2022
a6e3811
Modify release notes format script
freddyaboulton Oct 3, 2022
03c1b00
Fix format script + release notes
freddyaboulton Oct 3, 2022
55ac9bd
Add to contributing
freddyaboulton Oct 3, 2022
668c4e9
Undo change to release notes from testing script
freddyaboulton Oct 3, 2022
045ea76
Add pr 2373 to rl
freddyaboulton Oct 3, 2022
b5010e0
Modify file path
freddyaboulton Oct 3, 2022
dda07d9
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd Oct 3, 2022
cf939c2
Update .github/PULL_REQUEST_TEMPLATE.md
aliabd Oct 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,23 @@ Closes: # (issue)
# Checklist:

- [ ] I have performed a self-review of my own code
- [ ] I have added a short summary of my change to the CHANGELOG in website/CHANGELOG.md
- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes


# A note about the CHANGELOG

Hello 👋 and thank you for contributing to Gradio!

All pull requests must update the change log located in website/CHANGELOG.md unless they are labeled with the no-changelog-update label.
Comment thread
abidlabs marked this conversation as resolved.
Outdated

Please add a brief summary of the change to the Full Changelog section of the UPCOMING.md file and include the pr number.
For example, "* Added a cool new feature :pr:123".

If you would like to elaborate on your change further, feel free to include a longer explanation in the other sections.
If you would like an image/gif/video showcasing your feature, it may be best to edit the CHANGELOG file directly on the
Github web UI since that lets you upload files directly via drag-and-drop.
Comment thread
abidlabs marked this conversation as resolved.
Outdated
Comment thread
aliabd marked this conversation as resolved.
Outdated
20 changes: 20 additions & 0 deletions .github/workflows/check-changelog.yml
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]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The 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 }}"
27 changes: 26 additions & 1 deletion .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
gh-release:
needs: deploy
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_output.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set release name
Expand All @@ -57,4 +59,27 @@ jobs:
uses: softprops/action-gh-release@v1
with:
name: ${{ env.INPUT_NAME }}
tag_name: ${{ env.INPUT_NAME }}
tag_name: ${{ env.INPUT_NAME }}
body_path: website/releases/UPCOMING.md
- id: set_output
run: echo "::set-output name=version::${{ env.INPUT_NAME }}"
modify-release-notes:
needs: gh-release
runs-on: ubuntu-latest
if: ${{ !contains( needs.gh-release.outputs.version, 'b') }}
steps:
- uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Set release name
run: echo "INPUT_NAME=v$(cat gradio/version.txt)" >> $GITHUB_ENV
- name: Format Release Notes for Next Release
run: python scripts/format_release_notes.py ${{ env.INPUT_NAME }}
- name: Commit files
uses: EndBug/add-and-commit@v9
with:
add: website/releases
author_name: "GH ACTIONS"
author_email: ""
25 changes: 25 additions & 0 deletions scripts/format_release_notes.py
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",
Comment thread
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)

3 changes: 2 additions & 1 deletion website/homepage/build.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import shutil
import jinja2
from src import index, guides, docs, demos
from src import index, guides, docs, demos, changelog

SRC_DIR = "src"
BUILD_DIR = "build"
Expand All @@ -17,4 +17,5 @@
guides.build(BUILD_DIR, jinja_env)
docs.build(BUILD_DIR, jinja_env)
demos.build(BUILD_DIR, jinja_env)
changelog.build(BUILD_DIR, jinja_env)

38 changes: 38 additions & 0 deletions website/homepage/src/changelog/UPCOMING.html
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>
70 changes: 70 additions & 0 deletions website/homepage/src/changelog/__init__.py
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)
62 changes: 62 additions & 0 deletions website/homepage/src/changelog/parent_template.html
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>
Loading