Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
b7afb38
docs: update badges block and fix links to docs + demo actions
56kyle Dec 2, 2025
9bf9d86
docs: improve readme overall
56kyle Dec 4, 2025
cf9c69d
docs: move about summary to instead be the main summary
56kyle Dec 4, 2025
7fae0bd
docs: add shameless star request to readme
56kyle Dec 4, 2025
9fb391f
docs: remove unneeded line break after title due to automatic one in …
56kyle Dec 4, 2025
77a696c
docs: update usage information in readme
56kyle Dec 4, 2025
1a7f812
docs: add a section showing different permutation statuses for provid…
56kyle Dec 4, 2025
d0b3785
docs: slightly clarify wording in readme
56kyle Dec 4, 2025
7d358ff
docs: add current-status to the table of contents in readme
56kyle Dec 4, 2025
319e155
docs: update badges block and fix links to docs + demo actions
56kyle Dec 2, 2025
707334a
docs: improve readme overall
56kyle Dec 4, 2025
2c4464a
docs: move about summary to instead be the main summary
56kyle Dec 4, 2025
18be14b
docs: add shameless star request to readme
56kyle Dec 4, 2025
bbe0e7f
docs: remove unneeded line break after title due to automatic one in …
56kyle Dec 4, 2025
b378d48
docs: update usage information in readme
56kyle Dec 4, 2025
fbd0751
docs: add a section showing different permutation statuses for provid…
56kyle Dec 4, 2025
a4e1621
docs: slightly clarify wording in readme
56kyle Dec 4, 2025
57d9357
docs: add current-status to the table of contents in readme
56kyle Dec 4, 2025
0783cb7
Merge remote-tracking branch 'origin/docs/better-readme' into docs/be…
56kyle Dec 4, 2025
fd601f5
Merge branch 'develop' into docs/better-readme
56kyle Dec 4, 2025
cffc54e
fix: add two additional fetches that ensure branch actually exists lo…
56kyle Dec 4, 2025
48ede12
fix: remove backup creation of develop branch due to more purposeful …
56kyle Dec 4, 2025
33ad187
fix: replace check against commit hash to instead check against HEAD …
56kyle Dec 4, 2025
3758046
fix: try removing ancestry check to see if it actually matters
56kyle Dec 4, 2025
215cefb
Revert "fix: try removing ancestry check to see if it actually matters"
56kyle Dec 4, 2025
5759c2b
Revert "fix: replace check against commit hash to instead check again…
56kyle Dec 4, 2025
039f66d
chore: add some debug messaging
56kyle Dec 4, 2025
cbbce26
chore: add fetch depth to both template and demo
56kyle Dec 4, 2025
2a5f13c
fix: add git config to update-demo workflow
56kyle Dec 4, 2025
3a46af3
chore: move git configuration to act in the template repo
56kyle Dec 5, 2025
d294b57
chore: try swapping sync-demos to just be on non workflow targeted br…
56kyle Dec 5, 2025
00ee317
fix: adjust syntax to use branches-ignore in sync-demos workflow
56kyle Dec 5, 2025
2072585
fix: add passthrough for branch name to differentiate branch name sou…
56kyle Dec 8, 2025
0bbfdf5
fix: add --global kwargs to git config calls to see if that fixes the…
56kyle Dec 8, 2025
dcbebc3
chore: add token to demo checkout to see if it helps
56kyle Dec 8, 2025
1aef815
feat: replace default github token with premade PAT named DEMO_TOKEN
56kyle Dec 8, 2025
82707d7
feat: add workflow_call secrets passthrough
56kyle Dec 8, 2025
fd2614d
feat: add passthrough of DEMO_TOKEN wherever needed
56kyle Dec 8, 2025
095e6bf
feat: add GH_TOKEN adjacent to DEMO_TOKEN usages
56kyle Dec 8, 2025
037f27b
feat: add debugging logs marking the location of demo PR's made
56kyle Dec 8, 2025
d5f4b78
feat: remove extra url marker for stability temporarily
56kyle Dec 8, 2025
d6129d7
fix: add utf-8 decodes where missing
56kyle Dec 8, 2025
3e872f2
fix: remove decodes that aren't relevant
56kyle Dec 8, 2025
f61fb7c
chore: add some debugging statements
56kyle Dec 8, 2025
d657da3
fix: shrink the scope of text checked for to ensure differing gh cli …
56kyle Dec 8, 2025
2426bb7
chore: add a string wrapper to ensure stdout is comparing properly
56kyle Dec 8, 2025
64091d9
chore: add more debugging
56kyle Dec 8, 2025
20dc779
fix: swap to just checking return code
56kyle Dec 8, 2025
889ade9
feat: add additional note pointing toward newly made PR url
56kyle Dec 8, 2025
d01ac59
fix: adjust inversed returncode chec
56kyle Dec 8, 2025
c538b9b
feat: add pin image for use in readme
56kyle Dec 8, 2025
aa08733
docs: add pin images and generally pull a lot of inspiration from the…
56kyle Dec 8, 2025
e7f4ddf
docs: adjust links in pins to match section locations
56kyle Dec 8, 2025
b8cafe6
feat: improve the initial description and add a small blurb linking t…
56kyle Dec 8, 2025
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
4 changes: 4 additions & 0 deletions .github/workflows/merge-demo-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- "robust-maturin-demo"
with:
demo_name: ${{ matrix.demo_name }}
branch: ${{ github.ref_name }}

merge-demo-feature:
name: Merge Demo Feature
Expand All @@ -30,6 +31,8 @@ jobs:
demo_name:
- "robust-python-demo"
- "robust-maturin-demo"
env:
GH_TOKEN: ${{ secrets.DEMO_TOKEN }}
steps:
- name: Checkout Template
uses: actions/checkout@v4
Expand All @@ -42,6 +45,7 @@ jobs:
repository: "${{ github.repository_owner }}/${{ inputs.demo_name }}"
path: ${{ inputs.demo_name }}
ref: develop
token: ${{ secrets.DEMO_TOKEN }}

- name: Set up uv
uses: astral-sh/setup-uv@v6
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/sync-demos.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
name: sync-demo.yml
on:
pull_request:
branches:
- develop
push:
branches-ignore:
- "main"
- "develop"
- "release/*"

jobs:
update-demo:
Expand All @@ -15,3 +17,6 @@ jobs:
- "robust-maturin-demo"
with:
demo_name: ${{ matrix.demo_name }}
branch: ${{ github.ref_name }}
secrets:
DEMO_TOKEN: ${{ secrets.DEMO_TOKEN }}
17 changes: 16 additions & 1 deletion .github/workflows/update-demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ on:
demo_name:
required: true
type: string
branch:
required: true
type: string
secrets:
DEMO_TOKEN:
required: true

env:
COOKIECUTTER_ROBUST_PYTHON__DEMOS_CACHE_FOLDER: ${{ github.workspace }}
COOKIECUTTER_ROBUST_PYTHON__APP_AUTHOR: ${{ github.repository_owner }}
ROBUST_PYTHON_DEMO__APP_AUTHOR: ${{ github.repository_owner }}
ROBUST_MATURIN_DEMO__APP_AUTHOR: ${{ github.repository_owner }}
GH_TOKEN: ${{ secrets.DEMO_TOKEN }}

jobs:
update-demo:
Expand All @@ -19,16 +26,24 @@ jobs:
- name: Checkout Template
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: ${{ github.repository }}
path: "${{ github.workspace }}/cookiecutter-robust-python"

- name: Configure Git
working-directory: "${{ github.workspace }}/cookiecutter-robust-python"
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"

- name: Checkout Demo
uses: actions/checkout@v4
with:
fetch-depth: 0
repository: "${{ github.repository_owner }}/${{ inputs.demo_name }}"
path: ${{ inputs.demo_name }}
ref: develop
token: ${{ secrets.DEMO_TOKEN }}

- name: Set up uv
uses: astral-sh/setup-uv@v6
Expand All @@ -40,4 +55,4 @@ jobs:

- name: Update Demo
working-directory: "${{ github.workspace }}/cookiecutter-robust-python"
run: "uvx nox -s 'update-demo(${{ inputs.demo_name }})' -- --branch-override ${{ github.head_ref }}"
run: "uvx nox -s 'update-demo(${{ inputs.demo_name }})' -- --branch-override ${{ inputs.branch }}"
229 changes: 120 additions & 109 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions docs/_static/pin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 16 additions & 2 deletions scripts/update-demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def update_demo(
demo_name: str = get_demo_name(add_rust_extension=add_rust_extension)
demo_path: Path = demos_cache_folder / demo_name

typer.secho(f"template:\n\tcurrent_branch: {get_current_branch()}\n\tcurrent_commit: {get_current_commit()}")
if branch_override is not None:
typer.secho(f"Overriding current branch name for demo reference. Using '{branch_override}' instead.")
desired_branch_name: str = branch_override
Expand All @@ -76,6 +77,7 @@ def update_demo(

typer.secho(f"Updating demo project at {demo_path=}.", fg="yellow")
with work_in(demo_path):
typer.secho(f"demo:\n\tcurrent_branch: {get_current_branch()}\n\tcurrent_commit: {get_current_commit()}")
if get_current_branch() != desired_branch_name:
git("checkout", "-b", desired_branch_name, DEMO.develop_branch)

Expand Down Expand Up @@ -146,8 +148,10 @@ def _create_demo_pr(demo_path: Path, branch: str, commit_start: str) -> None:
"""Creates a PR to merge the given branch into develop."""
gh("repo", "set-default", f"{DEMO.app_author}/{DEMO.app_name}")
search_results: subprocess.CompletedProcess = gh("pr", "list", "--state", "open", "--search", branch)
if "no pull requests match your search" not in search_results.stdout:
typer.secho(f"Skipping PR creation due to existing PR found for branch {branch}")

if search_results.returncode == 0:
url: str = _get_pr_url(branch=branch)
typer.secho(f"Skipping PR creation due to existing PR found for branch {branch} at {url}")
return

body: str = _get_demo_feature_pr_body(demo_path=demo_path, commit_start=commit_start)
Expand All @@ -160,6 +164,16 @@ def _create_demo_pr(demo_path: Path, branch: str, commit_start: str) -> None:
"--repo": f"{DEMO.app_author}/{DEMO.app_name}",
}
gh("pr", "create", *itertools.chain.from_iterable(pr_kwargs.items()))
url: str = _get_pr_url(branch=branch)
typer.secho(f"Created PR for branch '{branch}' at '{url}'.")


def _get_pr_url(branch: str) -> str:
"""Returns the url of the current branch's PR."""
result: subprocess.CompletedProcess = gh("pr", "view", branch, "--json", "url", "--jq", ".url")
if result.returncode != 0:
raise ValueError(f"Failed to find a PR URL for branch {branch}.")
return result.stdout.strip()


def _get_demo_feature_pr_body(demo_path: Path, commit_start: str) -> str:
Expand Down
1 change: 1 addition & 0 deletions scripts/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def require_clean_and_up_to_date_demo_repo(demo_path: Path) -> None:
try:
with work_in(demo_path):
git("fetch")
git("fetch", "origin", f"{DEMO.main_branch}:{DEMO.main_branch}")
git("status", "--porcelain")
validate_is_synced_ancestor(ancestor=DEMO.main_branch, descendent=DEMO.develop_branch)
except Exception as e:
Expand Down