Skip to content
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

CI: Add labels to issue and PR and improve output from submission wf #481

Merged
merged 50 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cabecb9
force string for output
mickahell Jul 27, 2023
ee675cd
Revert "force string for output"
mickahell Jul 27, 2023
6c83731
Merge branch 'qiskit-community:main' into main
mickahell Jul 27, 2023
51c0f56
add assert for set_actions_output
mickahell Jul 29, 2023
97fb59f
Revert "add assert for set_actions_output"
mickahell Jul 29, 2023
4e47b0e
Merge branch 'qiskit-community:main' into main
mickahell Jul 31, 2023
82fdcd7
Merge branch 'qiskit-community:main' into main
mickahell Aug 3, 2023
924ee97
[CI] Dev and stable check only informational (#461)
mickahell Aug 1, 2023
fe4fd4e
Badges and stars update for 2023_08_02_13_46 (#474)
github-actions[bot] Aug 3, 2023
b47e815
Recompile members.json
invalid-email-address Aug 3, 2023
caaf6ea
Merge branch 'qiskit-community:main' into main
mickahell Aug 6, 2023
7c95567
Recompile members.json
mickahell Aug 3, 2023
0a1a15e
add labels
mickahell Aug 6, 2023
bc4d2c1
clean
mickahell Aug 6, 2023
0b48bea
clean
mickahell Aug 6, 2023
88cbca8
clean
mickahell Aug 6, 2023
c85953a
test with GITHUB_STEP_SUMMARY
mickahell Aug 6, 2023
58d5c57
test with GITHUB_STEP_SUMMARY
mickahell Aug 6, 2023
0666906
test redirect summary into var
mickahell Aug 6, 2023
c947e3e
test redirect summary into var
mickahell Aug 6, 2023
f79bf78
test redirect summary into var
mickahell Aug 6, 2023
8c02749
test redirect summary to file
mickahell Aug 6, 2023
d252629
test redirect summary to file
mickahell Aug 6, 2023
dae6154
test redirect summary to file
mickahell Aug 6, 2023
0e5ad14
test redirect summary to file
mickahell Aug 6, 2023
57256c5
test redirect summary to file
mickahell Aug 6, 2023
506a611
reordering
mickahell Aug 6, 2023
b7dc78a
remove labels option
mickahell Aug 6, 2023
3675d0c
use build script for labels
mickahell Aug 6, 2023
a57c494
use build script for labels
mickahell Aug 6, 2023
237d3b4
use build script for labels
mickahell Aug 6, 2023
91e10f4
use build script for labels
mickahell Aug 6, 2023
e563a4c
final test
mickahell Aug 6, 2023
06a3a80
add label from issue template
mickahell Aug 6, 2023
52208b5
clean members.json
mickahell Aug 6, 2023
c97318a
clean members.json
mickahell Aug 6, 2023
cf23a80
clean members.json
mickahell Aug 6, 2023
e20f586
Merge branch 'main' of github.com:mickahell/ecosystem into feature/pr…
mickahell Aug 6, 2023
9cbf07f
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
bab4e23
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
84f9734
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
388a155
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
8454073
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
c61b3d3
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
2e1ed7c
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
068b085
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
7153ab8
Update .github/workflows/ecosystem-submission.yml
mickahell Aug 12, 2023
956659e
merge script together
mickahell Aug 16, 2023
0fe34c9
comment not bash
mickahell Aug 16, 2023
d961fd5
comment not bash
mickahell Aug 16, 2023
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/submission.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Project submission
description: Ecosystem project submission
title: "[Submission]: "
labels: []
labels: ["submission"]
assignees:
- octocat
body:
Expand Down
224 changes: 152 additions & 72 deletions .github/workflows/ecosystem-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Ecosystem | Submission check
# - install deps
# - parse issue
# - run lint, coverage, tests
# - comment result
# - link pr to issue
# - create pr
# - comment result and add labels

on:
issues:
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-dev.txt

# workflow
# Python workflow
- name: Parse submission
id: parse-issue
env:
Expand All @@ -49,7 +49,7 @@ jobs:
test_type: "stable"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
logs_link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Tests dev check
id: dev
uses: ./.github/actions/run-tests
Expand All @@ -58,7 +58,7 @@ jobs:
test_type: "development"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
logs_link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Tests standard repo check
id: standard
uses: ./.github/actions/run-tests
Expand All @@ -67,33 +67,7 @@ jobs:
test_type: "standard"
tox_env: ${{ env.tox_env }}
tier: ${{ env.tier }}
logs_link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}

# Check result, update issue and create PR
- name: Check return
id: check-return
run: |
if [[ "${{ steps.standard.outputs.result }}" == *"True"* ]]; then
echo "::notice title=StandardCheck::Success"
echo "PASS_STD=True" >> "$GITHUB_OUTPUT"
else
echo "::error title=StandardCheck::Didn't pass"
echo "PASS_STD=False" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ steps.stable.outputs.result }}" == *"True"* ]]; then
echo "::notice title=StableCheck::Success"
echo "PASS_STB=True" >> "$GITHUB_OUTPUT"
else
echo "::warning title=StableCheck::Didn't pass"
echo "PASS_STB=False" >> "$GITHUB_OUTPUT"
fi
if [[ "${{ steps.dev.outputs.result }}" == *"True"* ]]; then
echo "::notice title=DevCheck::Success"
echo "PASS_DEV=True" >> "$GITHUB_OUTPUT"
else
echo "::warning title=DevCheck::Didn't pass"
echo "PASS_DEV=False" >> "$GITHUB_OUTPUT"
fi
logs_link: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}

- name: Add member
env:
Expand All @@ -117,6 +91,7 @@ jobs:
--repo_labels="$SUBMISSION_LABELS" \
--repo_website="$SUBMISSION_WEBSITE"

# Create PR
- name: Commit changes and create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v5
Expand All @@ -125,63 +100,168 @@ jobs:
title: Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.
body: |
Add ${{ steps.parse-issue.outputs.SUBMISSION_NAME }} to list.

---
Closes #${{ github.event.issue.number }}
branch: submission-${{ github.event.issue.number }}
labels: submission
base: main

- name: Create comment on success for standard check
# Check result
- name: Check test results
# Gets results of repo tests, and creates comment to post to issue
id: check-return
run: |
# STD check
echo "### Standard tests" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.standard.outputs.result }}" == *"True"* ]]; then
echo "PASS_STD=True" >> "$GITHUB_OUTPUT"
echo ":sparkles: Successfull submission!" >> $GITHUB_STEP_SUMMARY
else
echo "PASS_STD=False" >> "$GITHUB_OUTPUT"
echo ":x: The submission didn't pass the standard check." >> $GITHUB_STEP_SUMMARY
echo "Please follow minimal requirements for project or/and add ecosystem.json configuration in the root of the project." >> $GITHUB_STEP_SUMMARY
echo "Read more here ${{ github.server_url }}/${{ github.repository }}/blob/main/docs/project_overview.md#adding-project-to-the-ecosystem." >> $GITHUB_STEP_SUMMARY
fi

# STB check
echo "### Stable tests" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.stable.outputs.result }}" == *"True"* ]]; then
echo "PASS_STB=True" >> "$GITHUB_OUTPUT"
echo ":sparkles: Tests with latest version of Qiskit release passed!" >> $GITHUB_STEP_SUMMARY
else
echo "PASS_STB=False" >> "$GITHUB_OUTPUT"
echo ":warning: The submission didn't pass the stable check." >> $GITHUB_STEP_SUMMARY
echo "This means your project doesn't work with the latest version of Qiskit." >> $GITHUB_STEP_SUMMARY
echo "This is purely informational and doesn't affect your project joining the Ecosystem, but you may want to investigate the problem." >> $GITHUB_STEP_SUMMARY
fi

# DEV check
echo "### Development tests" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.dev.outputs.result }}" == *"True"* ]]; then
echo "PASS_DEV=True" >> "$GITHUB_OUTPUT"
echo ":sparkles: Tests with development version of Qiskit release passed!" >> $GITHUB_STEP_SUMMARY
else
echo "PASS_DEV=False" >> "$GITHUB_OUTPUT"
echo ":warning: The submission didn't pass the development check." >> $GITHUB_STEP_SUMMARY
echo "This means your project might not work with the next version of Qiskit." >> $GITHUB_STEP_SUMMARY
echo "This is purely informational and doesn't affect your project joining Ecosystem." >> $GITHUB_STEP_SUMMARY
fi

# Gen info
echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "Logs: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_STEP_SUMMARY
echo "PR #${{ steps.cpr.outputs.pull-request-number }}" >> $GITHUB_STEP_SUMMARY
# Create summary_output.md
echo "$(cat $GITHUB_STEP_SUMMARY)" > summary_output.md

# PR labels and comment
- name: 'PR: Add "ready" label'
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD == 'True' }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Successfull submission! :sparkles: PR #${{ steps.cpr.outputs.pull-request-number }}
script: |
github.rest.issues.addLabels({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["ready"]
})
- name: 'PR: Remove "on hold" label'
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD == 'True' }}
with:
script: |
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})

- name: Create comment on failure
- name: 'PR: Add "on hold" label'
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD != 'True' }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Submission PR #${{ steps.cpr.outputs.pull-request-number }} has been created with errors in tests :warning:
See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }}
Please follow minimal requirements for project or/and add `ecosystem.json` configuration in the root of the project
Read more here https://github.com/qiskit-community/ecosystem/blob/main/docs/project_overview.md#adding-project-to-the-ecosystem
script: |
github.rest.issues.addLabels({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["on hold"]
})
- name: 'PR: Remove "ready" label'
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD != 'True' }}
with:
script: |
github.rest.issues.removeLabel({
issue_number: ${{ steps.cpr.outputs.pull-request-number }},
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})

- name: Create comment on success for stable check
if: ${{ steps.check-return.outputs.PASS_STB == 'True' }}
- name: 'PR: Post comment'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Tests with latest version of Qiskit release passed! :sparkles:
issue-number: ${{ steps.cpr.outputs.pull-request-number }}
body-path: "summary_output.md"

- name: Create comment on failure for stable check
if: ${{ steps.check-return.outputs.PASS_STB != 'True' }}
uses: peter-evans/create-or-update-comment@v3
# Issue labels and comment
- name: 'Issue: Add "ready" label'
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD == 'True' }}
with:
issue-number: ${{ github.event.issue.number }}
body: |
Tests with latest version of Qiskit release failed! :warning:
This means your project doesn't work with the latest version of Qiskit.
This is purely informational and doesn't affect your project joining the Ecosystem, but you may want to investigate the problem.
See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }}
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["ready"]
})
- name: PR labeling status ready remove on hold
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD == 'True' }}
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["on hold"]
})
mickahell marked this conversation as resolved.
Show resolved Hide resolved
mickahell marked this conversation as resolved.
Show resolved Hide resolved

- name: Create comment on success for dev check
if: ${{ steps.check-return.outputs.PASS_DEV == 'True' }}
uses: peter-evans/create-or-update-comment@v3
- name: 'Issue: Add "on hold" label'
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD != 'True' }}
with:
issue-number: ${{ github.event.issue.number }}
body: |
Tests with development version of Qiskit release passed! :sparkles:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["on hold"]
})
- name: PR labeling status on hold remove ready
continue-on-error: true
uses: actions/github-script@v6
if: ${{ steps.check-return.outputs.PASS_STD != 'True' }}
with:
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: ["ready"]
})
mickahell marked this conversation as resolved.
Show resolved Hide resolved
mickahell marked this conversation as resolved.
Show resolved Hide resolved

- name: Create comment on failure for dev check
if: ${{ steps.check-return.outputs.PASS_DEV != 'True' }}
- name: 'Issue: Post comment'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
Tests with development version of Qiskit release failed! :warning:
This means your project might not work with the next version of Qiskit.
This is purely informational and doesn't affect your project joining Ecosystem.
See logs: https://github.com/qiskit-community/ecosystem/actions/runs/${{ github.run_id }}
body-path: "summary_output.md"