-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link to demo in PR + check checkboxes (#2543)
<!-- Open the PR up as a draft until you feel it is ready for a proper review. Do not make PR:s from your own `main` branch, as that makes it difficult for reviewers to add their own fixes. Add any improvements to the branch as new commits to make it easier for reviewers to follow the progress. All commits will be squashed to a single commit once the PR is merged into `main`. Make sure you mention any issues that this PR closes in the description, as well as any other related issues. To get an auto-generated PR description you can put "copilot:summary" or "copilot:walkthrough" anywhere. --> ### What Part of #2167 ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested https://demo.rerun.io/pr/2543 (if applicable) <!-- This line will get updated when the PR build summary job finishes. --> PR Build Summary: https://build.rerun.io/pr/2543 <!-- pr-link-docs:start --> Docs preview: https://rerun.io/preview/2ceab68/docs Examples preview: https://rerun.io/preview/2ceab68/examples <!-- pr-link-docs:end -->
- Loading branch information
Showing
10 changed files
with
156 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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 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 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,46 @@ | ||
# Checks that all checkboxes in a PR are checked | ||
|
||
name: Pull Request Checkboxes | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- edited | ||
|
||
concurrency: | ||
group: ${{ github.event.pull_request.number }}-pr-checkboxes | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pr-checkboxes: | ||
name: Check PR checkboxes | ||
|
||
permissions: | ||
contents: "read" | ||
id-token: "write" | ||
pull-requests: "write" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install deps | ||
run: pip install PyGithub # NOLINT | ||
|
||
- name: Check PR checkboxes | ||
run: | | ||
./scripts/check_pr_checkboxes.py \ | ||
--github-token ${{ secrets.GITHUB_TOKEN }} \ | ||
--github-repository ${{ github.repository }} \ | ||
--pr-number ${{ github.event.pull_request.number }} | ||
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 'Checks: Lints, Tests, Docs' | ||
name: "Checks: Lints, Tests, Docs" | ||
|
||
on: | ||
workflow_call: | ||
|
@@ -22,6 +22,10 @@ on: | |
required: false | ||
type: boolean | ||
default: false | ||
PR_NUMBER: | ||
required: false | ||
type: string | ||
default: "" | ||
|
||
concurrency: | ||
group: ${{ inputs.CONCURRENCY }}-checks | ||
|
@@ -42,8 +46,7 @@ env: | |
RUSTC_WRAPPER: "sccache" | ||
|
||
jobs: | ||
|
||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
py-lints: | ||
name: Python lints (black, mypy, flake8) | ||
|
@@ -76,7 +79,7 @@ jobs: | |
run: | | ||
just py-requirements | ||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
py-test-docs: | ||
name: Test Python Docs | ||
|
@@ -100,7 +103,7 @@ jobs: | |
run: | | ||
mkdocs build -f rerun_py/mkdocs.yml | ||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
rs-lints: | ||
name: Rust lints (fmt, check, cranky, tests, doc) | ||
|
@@ -139,7 +142,6 @@ jobs: | |
- name: Run sccache-cache | ||
uses: mozilla-actions/[email protected] | ||
|
||
|
||
# First do our check with --locked to make sure `Cargo.lock` is up to date | ||
- name: Check all features | ||
uses: actions-rs/cargo@v1 | ||
|
@@ -203,7 +205,7 @@ jobs: | |
command: test | ||
args: --all-targets --all-features | ||
|
||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
rs-check-wasm: | ||
name: Check Rust web build (wasm32 + wasm-bindgen) | ||
|
@@ -240,13 +242,12 @@ jobs: | |
command: run | ||
args: --locked -p re_build_web_viewer -- --debug | ||
|
||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
toml-lints: | ||
name: Lint TOML files | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up cargo cache | ||
|
@@ -268,7 +269,7 @@ jobs: | |
run: | | ||
taplo fmt --check | ||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
misc-rerun-lints: | ||
name: Rerun lints | ||
|
@@ -293,7 +294,7 @@ jobs: | |
run: | | ||
./scripts/check_requirements.py | ||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
spell-check: | ||
name: Spell Check | ||
|
@@ -305,7 +306,7 @@ jobs: | |
- name: Check spelling of entire workspace | ||
uses: crate-ci/typos@master | ||
|
||
# --------------------------------------------------------------------------- | ||
# --------------------------------------------------------------------------- | ||
|
||
rs-cargo-deny: | ||
name: Cargo Deny ${{ matrix.platform }} | ||
|
@@ -324,3 +325,4 @@ jobs: | |
shell: bash | ||
id: expected_version | ||
run: ./scripts/cargo_deny.sh | ||
|
This file contains 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 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 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,37 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
|
||
from github import Github # NOLINT | ||
|
||
|
||
def main() -> None: | ||
parser = argparse.ArgumentParser(description="Generate a PR summary page") | ||
parser.add_argument("--github-token", required=True, help="GitHub token") | ||
parser.add_argument("--github-repository", required=True, help="GitHub repository") | ||
parser.add_argument("--pr-number", required=True, type=int, help="PR number") | ||
args = parser.parse_args() | ||
|
||
gh = Github(args.github_token) # NOLINT | ||
repo = gh.get_repo(args.github_repository) | ||
pr = repo.get_pull(args.pr_number) | ||
|
||
latest_commit = pr.get_commits().reversed[0] | ||
print(f"Latest commit: {latest_commit.sha}") | ||
|
||
body_lower = pr.body.lower() | ||
if "* [ ]" in body_lower or "- [ ]" in body_lower: | ||
print("PR contains unchecked checkboxes") | ||
exit(1) | ||
elif "* [x]" in body_lower or "- [x]" in body_lower: | ||
print("All clear") | ||
exit(0) | ||
else: | ||
print("Don't delete the PR description") | ||
exit(1) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains 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
Oops, something went wrong.