-
Notifications
You must be signed in to change notification settings - Fork 10
Add PR Template #1172
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
Open
christiefhyang
wants to merge
19
commits into
main
Choose a base branch
from
christiefhyang
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add PR Template #1172
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
71740ba
Create draft pull request template
christiefhyang aa0bb14
Add placeholder to onboarding documentation
christiefhyang 830c9c4
Update pull request template to remove draft notice
christiefhyang cb8ea95
Delete docs/onboarding.md
christiefhyang 773911e
Revise pull request template structure and content
christiefhyang e73ef26
Create CLA.md
christiefhyang c9198fc
Update CLA.md
christiefhyang e8dd924
Update pull_request_template.md
christiefhyang 7982eba
Add PR test script for multiple languages
christiefhyang 4e93c70
CI code cleanup
christiefhyang 9ee6e52
Add PR CI workflow
christiefhyang 60d1162
Rename scripts/.github/workflows/pr.yml to .github/workflows/pr.yml
christiefhyang 3401bf6
Rename pull_request_template.md to .github/pull_request_template.md
christiefhyang 1004654
Update pull_request_template.md
christiefhyang 18b63d2
Enhance test_pr.sh with additional checks and error handling
christiefhyang cc4c761
Revise CLA for DimOS project clarity
christiefhyang 3e30206
Update permissions for pull request workflow
christiefhyang 4c6fdf0
Update permissions for pull request workflow
christiefhyang 43f9762
Update permissions for pull request workflow
christiefhyang 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ## Problem | ||
| <!-- What feature are you adding, or what is broken/missing/sub-optimal? --> | ||
| <!-- Context, symptoms, motivation. Link the issue. --> | ||
|
|
||
| Issue: # | ||
|
|
||
| --- | ||
|
|
||
| ## Solution | ||
| <!-- What you changed and why this approach --> | ||
| <!-- Key design decisions / tradeoffs --> | ||
| <!-- Keep it high-signal; deep planning belongs in the issue. --> | ||
|
|
||
| --- | ||
|
|
||
| ## Breaking Changes | ||
| <!-- Write "None" if not applicable --> | ||
|
|
||
| None | ||
|
|
||
| <!-- If applicable: | ||
| - What breaks | ||
| - Who is affected | ||
| - Migration steps | ||
| --> | ||
|
|
||
| --- | ||
|
|
||
| ## How to Test | ||
| <!-- MUST be reproducible. If this section is weak, reviewers can't approve confidently. --> | ||
|
|
||
| ### One-command PR verification (required) | ||
| ```bash | ||
| bash scripts/test_pr.sh | ||
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,21 @@ | ||
| name: PR Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| packages: write | ||
| pull-requests: read | ||
| workflows: write | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run PR test script | ||
| run: bash scripts/test_pr.sh | ||
|
||
|
|
||
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,31 @@ | ||
| # Contributor License Agreement (CLA) | ||
|
|
||
| Thank you for your interest in contributing to the DimOS project maintained by Dimensional Inc.. | ||
|
|
||
| For the purposes of this agreement, a "Contribution" means any code, documentation, or other material intentionally submitted for inclusion in the project. | ||
|
|
||
| In order to accept contributions, we require contributors to agree to the following terms. | ||
|
|
||
| ## 1. Grant of License | ||
|
|
||
| By submitting a contribution, you grant the project maintainers and users a perpetual, worldwide, non-exclusive, royalty-free license to use, reproduce, modify, distribute, and sublicense your contribution as part of the project. | ||
|
|
||
| All contributions will be licensed under the terms of the repository's LICENSE file unless otherwise stated. | ||
|
|
||
| ## 2. Ownership and Rights | ||
|
|
||
| You represent that: | ||
|
|
||
| - You are the original author of the contribution, or | ||
| - You have the legal right to submit the contribution, and | ||
| - The contribution does not knowingly violate the rights of any third party. | ||
|
|
||
| If you are contributing on behalf of an employer, you represent that your employer has authorized the contribution. | ||
|
|
||
| ## 3. No Warranty | ||
|
|
||
| Contributions are provided "as is" without warranties or conditions of any kind. | ||
|
|
||
| ## 4. Agreement | ||
|
|
||
| By submitting a pull request to this repository, you agree to the terms of this Contributor License Agreement. |
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,68 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| echo "== PR Test Script ==" | ||
| echo "Repo: $(basename "$(git rev-parse --show-toplevel)")" | ||
| echo "Commit: $(git rev-parse --short HEAD)" | ||
| echo | ||
|
|
||
| ran_anything=0 | ||
|
|
||
| # -------- Python (if present) -------- | ||
| if [[ -f "pyproject.toml" || -f "requirements.txt" ]]; then | ||
| ran_anything=1 | ||
| echo "== Python checks ==" | ||
| python -V | ||
| python -m pip --version | ||
| python -m pip install --upgrade pip | ||
|
|
||
| if [[ -f "requirements.txt" ]]; then | ||
| python -m pip install -r requirements.txt | ||
| fi | ||
|
|
||
| # If you have a dev requirements file, this is common: | ||
| if [[ -f "requirements-dev.txt" ]]; then | ||
| python -m pip install -r requirements-dev.txt | ||
| fi | ||
|
|
||
| # Require pytest if this is a Python repo | ||
| if ! command -v pytest >/dev/null 2>&1; then | ||
| echo "ERROR: pytest not installed. Add it to requirements-dev.txt (or project deps)." | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Lint/format are optional, but if present, run them | ||
| command -v ruff >/dev/null 2>&1 && ruff check . | ||
| command -v black >/dev/null 2>&1 && black --check . | ||
|
|
||
| pytest -q | ||
| echo | ||
| fi | ||
|
|
||
| # -------- Node (if present) -------- | ||
| if [[ -f "package.json" ]]; then | ||
| ran_anything=1 | ||
| echo "== Node checks ==" | ||
| npm ci | ||
| npm test | ||
| echo | ||
| fi | ||
|
|
||
| # -------- CMake/C++ (if present) -------- | ||
| if [[ -f "CMakeLists.txt" ]]; then | ||
| ran_anything=1 | ||
| echo "== CMake checks ==" | ||
| rm -rf build | ||
| cmake -S . -B build -DCMAKE_BUILD_TYPE=Release | ||
| cmake --build build -j | ||
| ctest --test-dir build --output-on-failure | ||
| echo | ||
| fi | ||
|
|
||
| if [[ "$ran_anything" -eq 0 ]]; then | ||
| echo "ERROR: No recognized project type detected (no pyproject.toml/requirements.txt/package.json/CMakeLists.txt)." | ||
| echo "Add checks for your repo’s build/test commands." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "✅ All PR checks passed." |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? I think people have to add their own command for how to test it.