[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Check for Change-Id in GitHub Actions

2023-07-07 Thread Bobby Bruce (Gerrit) via gem5-dev
Bobby Bruce has submitted this change. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email )


Change subject: misc: Check for Change-Id in GitHub Actions
..

misc: Check for Change-Id in GitHub Actions

This adds a check to our continous integration tests that ensures
that every single commit in a pull request has a Change-Id, and
instructs you to add one if that check fails.  This ensures all
commits on GitHub are still compatible with Gerrit.

Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/72118
Tested-by: kokoro 
Reviewed-by: Jason Lowe-Power 
Maintainer: Jason Lowe-Power 
Maintainer: Bobby Bruce 
Reviewed-by: Richard Cooper 
Reviewed-by: Bobby Bruce 
---
M .github/workflows/ci-tests.yaml
1 file changed, 26 insertions(+), 3 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, but someone else must approve; Looks  
good to me, approved

  Richard Cooper: Looks good to me, but someone else must approve
  kokoro: Regressions pass
  Bobby Bruce: Looks good to me, approved; Looks good to me, approved




diff --git a/.github/workflows/ci-tests.yaml  
b/.github/workflows/ci-tests.yaml

index 61ba4b5..c3188b8 100644
--- a/.github/workflows/ci-tests.yaml
+++ b/.github/workflows/ci-tests.yaml
@@ -16,10 +16,33 @@
 - uses: actions/setup-python@v3
 - uses: pre-commit/action@v3.0.0

+  # ensures we have a change-id in every commit, needed for gerrit
+  check-for-change-id:
+# runs on github hosted runner
+runs-on: ubuntu-latest
+container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
+steps:
+  - uses: actions/github-script@v6
+env:
+  token: "Change-Id"
+  pattern: ".*"
+with:
+  script: |
+const commits = ${{ toJSON(github.event.commits) }}
+for (const commit of commits) {
+  const id = "Change-Id: "
+  const message = commit.message;
+  if (!message.includes(id)) {
+core.setFailed('One or more of the commits in this pull  
request is missing a Change-ID, which we require for any changes made to  
gem5. ' +
+'To automatically insert one, run the following:\n f=`git  
rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; ' +
+'curl -Lo $f  
https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x  
$f\n Then amend the commit with git commit --amend --no-edit, and update  
your pull request.')

+  }
+}
+
   build-gem5:
 runs-on: [self-hosted, linux, x64, build]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 outputs:
   artifactname: ${{ steps.name.outputs.test }}
 steps:
@@ -39,7 +62,7 @@
   unittests-all-opt:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 timeout-minutes: 60
 steps:
   - uses: actions/checkout@v3
@@ -51,7 +74,7 @@
   testlib-quick:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: [pre-commit, build-gem5]
+needs: [pre-commit, check-for-change-id, build-gem5]
 timeout-minutes: 360 # 6 hours
 steps:
   - uses: actions/checkout@v3

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings?usp=email


Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: stable
Gerrit-Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
Gerrit-Change-Number: 72118
Gerrit-PatchSet: 2
Gerrit-Owner: Melissa Jost 
Gerrit-Reviewer: Bobby Bruce 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Jason Lowe-Power 
Gerrit-Reviewer: Richard Cooper 
Gerrit-Reviewer: kokoro 
Gerrit-CC: kokoro 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org


[gem5-dev] [S] Change in gem5/gem5[stable]: misc: Check for Change-Id in GitHub Actions

2023-07-06 Thread Melissa Jost (Gerrit) via gem5-dev
Melissa Jost has uploaded this change for review. (  
https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email )



Change subject: misc: Check for Change-Id in GitHub Actions
..

misc: Check for Change-Id in GitHub Actions

This adds a check to our continous integration tests that ensures
that every single commit in a pull request has a Change-Id, and
instructs you to add one if that check fails.  This ensures all
commits on GitHub are still compatible with Gerrit.

Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
---
M .github/workflows/ci-tests.yaml
1 file changed, 26 insertions(+), 3 deletions(-)



diff --git a/.github/workflows/ci-tests.yaml  
b/.github/workflows/ci-tests.yaml

index 61ba4b5..c3188b8 100644
--- a/.github/workflows/ci-tests.yaml
+++ b/.github/workflows/ci-tests.yaml
@@ -16,10 +16,33 @@
 - uses: actions/setup-python@v3
 - uses: pre-commit/action@v3.0.0

+  # ensures we have a change-id in every commit, needed for gerrit
+  check-for-change-id:
+# runs on github hosted runner
+runs-on: ubuntu-latest
+container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
+steps:
+  - uses: actions/github-script@v6
+env:
+  token: "Change-Id"
+  pattern: ".*"
+with:
+  script: |
+const commits = ${{ toJSON(github.event.commits) }}
+for (const commit of commits) {
+  const id = "Change-Id: "
+  const message = commit.message;
+  if (!message.includes(id)) {
+core.setFailed('One or more of the commits in this pull  
request is missing a Change-ID, which we require for any changes made to  
gem5. ' +
+'To automatically insert one, run the following:\n f=`git  
rev-parse --git-dir`/hooks/commit-msg ; mkdir -p $(dirname $f) ; ' +
+'curl -Lo $f  
https://gerrit-review.googlesource.com/tools/hooks/commit-msg ; chmod +x  
$f\n Then amend the commit with git commit --amend --no-edit, and update  
your pull request.')

+  }
+}
+
   build-gem5:
 runs-on: [self-hosted, linux, x64, build]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 outputs:
   artifactname: ${{ steps.name.outputs.test }}
 steps:
@@ -39,7 +62,7 @@
   unittests-all-opt:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: pre-commit # only runs if pre-commit passes
+needs: [pre-commit, check-for-change-id] # only runs if pre-commit and  
change-id passes

 timeout-minutes: 60
 steps:
   - uses: actions/checkout@v3
@@ -51,7 +74,7 @@
   testlib-quick:
 runs-on: [self-hosted, linux, x64, run]
 container: gcr.io/gem5-test/ubuntu-22.04_all-dependencies:latest
-needs: [pre-commit, build-gem5]
+needs: [pre-commit, check-for-change-id, build-gem5]
 timeout-minutes: 360 # 6 hours
 steps:
   - uses: actions/checkout@v3

--
To view, visit  
https://gem5-review.googlesource.com/c/public/gem5/+/72118?usp=email
To unsubscribe, or for help writing mail filters, visit  
https://gem5-review.googlesource.com/settings?usp=email


Gerrit-MessageType: newchange
Gerrit-Project: public/gem5
Gerrit-Branch: stable
Gerrit-Change-Id: I3fd753da5ab3ca6d6334a8e0eb574433aa1ca589
Gerrit-Change-Number: 72118
Gerrit-PatchSet: 1
Gerrit-Owner: Melissa Jost 
___
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org