Skip to content

Commit

Permalink
Backport of CI Split integration tests to run nightly and every PR in…
Browse files Browse the repository at this point in the history
…to release/1.16.x (#18520)

resolve conflict

Co-authored-by: temp <[email protected]>

Backport of bug: prevent go routine leakage due to existing DeferCheck into release/1.16.x (#18565)

* backport of commit 06d4c72

* backport of commit 42c37bb

---------

Co-authored-by: cskh <[email protected]>

fix for , non presence of consul-version meta (#18464) (#18561)

* fix for #18406 , non presence of consul-version meta

Co-authored-by: Vijay <[email protected]>

[BACKPORT] 1.16.x manual backport of OSS->CE branch (#18549)

Backport of NET-5382 & PLAT-1159: Do not trigger workflow if only doc files are in commit history into release/1.16.x (#18570)

backport of commit c833fcc

Co-authored-by: NiniOak <[email protected]>

Backport of docs: Fix spelling errors across various pages on the site into release/1.16.x (#18537)

docs: Fix spelling errors across various pages on the site (#18533)

This commit fixes numerous spelling errors across the site and also
removes unnecessary whitespace that was present in the edited files.

Co-authored-by: Blake Covarrubias <[email protected]>

Backport of Fix broken link on sameness group page into release/1.16.x (#18588)

backport of commit 05dd1a8

Co-authored-by: Tu Nguyen <[email protected]>
  • Loading branch information
2 people authored and absolutelightning committed Sep 4, 2023
1 parent ec365dc commit 3cf0607
Show file tree
Hide file tree
Showing 280 changed files with 1,795 additions and 1,408 deletions.
3 changes: 3 additions & 0 deletions .changelog/18464.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
UI : Nodes list view was breaking for synthetic-nodes. Fix handles non existence of consul-version meta for node.
```
3 changes: 3 additions & 0 deletions .changelog/18558.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
check: prevent go routine leakage when existing Defercheck of same check id is not nil
```
33 changes: 33 additions & 0 deletions .github/scripts/filter_changed_files_go_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Get the list of changed files
files_to_check=$(git diff --name-only origin/$GITHUB_BASE_REF)

# Define the directories to check
skipped_directories=("docs/" "ui/" "website/" "grafana/")

# Initialize a variable to track directories outside the skipped ones
other_directories=""
trigger_ci=false

# Loop through the changed files and find directories/files outside the skipped ones
for file_to_check in $files_to_check; do
file_is_skipped=false
for dir in "${skipped_directories[@]}"; do
if [[ "$file_to_check" == "$dir"* ]] || [[ "$file_to_check" == *.md && "$dir" == *"/" ]]; then
file_is_skipped=true
break
fi
done
if [ "$file_is_skipped" = "false" ]; then
other_directories+="$(dirname "$file_to_check")\n"
trigger_ci=true
echo "Non doc file(s) changed - triggered ci: $trigger_ci"
echo -e $other_directories
echo "trigger-ci=$trigger_ci" >>"$GITHUB_OUTPUT"
exit 0 ## if file is outside of the skipped_directory exit script
fi
done

echo "Only doc file(s) changed - triggered ci: $trigger_ci"
echo "trigger-ci=$trigger_ci" >>"$GITHUB_OUTPUT"
2 changes: 1 addition & 1 deletion .github/scripts/get_runner_classes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ case "$GITHUB_REPOSITORY" in
echo "compute-small=['self-hosted', 'linux', 'small']" >> "$GITHUB_OUTPUT"
echo "compute-medium=['self-hosted', 'linux', 'medium']" >> "$GITHUB_OUTPUT"
echo "compute-large=['self-hosted', 'linux', 'large']" >> "$GITHUB_OUTPUT"
# m5d.8xlarge is equivalent to our xl custom runner in OSS
# m5d.8xlarge is equivalent to our xl custom runner in CE
echo "compute-xl=['self-hosted', 'ondemand', 'linux', 'type=m5d.8xlarge']" >> "$GITHUB_OUTPUT"
;;
*)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f03ac48505955848960e80bbb68046aa35c7b9e7 # [email protected]

# NOTE: conditional specific logic as we store secrets in Vault in ENT and use GHA secrets in OSS.
# NOTE: conditional specific logic as we store secrets in Vault in ENT and use GHA secrets in CE.
- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # [email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:

env:
PKG_NAME: consul
# TODO(spatel): CE refactor
METADATA: oss
GOPRIVATE: github.com/hashicorp # Required for enterprise deps

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

name: Trigger OSS to Enterprise Merge
name: Trigger Community Edition to Enterprise Merge
on:
pull_request_target:
types:
Expand All @@ -11,8 +11,8 @@ on:
- 'release/*.*.x'

jobs:
trigger-oss-merge:
# run this only on merge events in OSS repo
trigger-ce-merge:
# run this only on merge events in CE repo
if: ${{ github.event.pull_request.merged && github.repository == 'hashicorp/consul' }}
runs-on: ubuntu-latest
steps:
Expand All @@ -22,8 +22,9 @@ jobs:
GIT_SHA: ${{ github.sha }}
GH_PAT: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
GIT_ACTOR: ${{ github.actor }}
# TODO(spatel): CE refactor
run: |
curl -H "Authorization: token $GH_PAT" \
-H 'Accept: application/json' \
-d "{\"event_type\": \"oss-merge\", \"client_payload\": {\"git-ref\": \"${GIT_REF}\", \"git-sha\": \"${GIT_SHA}\", \"git-actor\": \"${GIT_ACTOR}\" }}" \
"https://api.github.com/repos/hashicorp/consul-enterprise/dispatches"
"https://api.github.com/repos/hashicorp/consul-enterprise/dispatches"
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
matrix:
partition: [1, 2, 3, 4]
env:
EMBER_TEST_REPORT: test-results/report-oss.xml # outputs test report for CI test summary
EMBER_TEST_REPORT: test-results/report-ce.xml # outputs test report for CI test summary
EMBER_TEST_PARALLEL: true # enables test parallelization with ember-exam
CONSUL_NSPACES_ENABLED: ${{ endsWith(github.repository, '-enterprise') && 1 || 0 }} # NOTE: this should be 1 in ENT.
JOBS: 2 # limit parallelism for broccoli-babel-transpiler
Expand Down
26 changes: 21 additions & 5 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,23 @@ env:
GOPRIVATE: github.com/hashicorp # Required for enterprise deps

jobs:
conditional-skip:
runs-on: ubuntu-latest
name: Get files changed and conditionally skip CI
outputs:
trigger-ci: ${{ steps.read-files.outputs.trigger-ci }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Get changed files
id: read-files
run: ./.github/scripts/filter_changed_files_go_test.sh

setup:
needs: [conditional-skip]
name: Setup
if: needs.conditional-skip.outputs.trigger-ci == 'true'
runs-on: ubuntu-latest
outputs:
compute-small: ${{ steps.setup-outputs.outputs.compute-small }}
Expand Down Expand Up @@ -198,7 +213,7 @@ jobs:
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

# dev-build-arm64:
# # only run on enterprise because GHA does not have arm64 runners in OSS
# # only run on enterprise because GHA does not have arm64 runners in CE
# if: ${{ endsWith(github.repository, '-enterprise') }}
# needs:
# - setup
Expand All @@ -212,7 +227,7 @@ jobs:
# elevated-github-token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

# go-test-arm64:
# # only run on enterprise because GHA does not have arm64 runners in OSS
# # only run on enterprise because GHA does not have arm64 runners in CE
# if: ${{ endsWith(github.repository, '-enterprise') }}
# needs:
# - setup
Expand All @@ -230,7 +245,7 @@ jobs:
# consul-license: ${{secrets.CONSUL_LICENSE}}
# datadog-api-key: "${{ !endsWith(github.repository, '-enterprise') && secrets.DATADOG_API_KEY || '' }}"

go-test-oss:
go-test-ce:
needs:
- setup
- dev-build
Expand Down Expand Up @@ -463,6 +478,7 @@ jobs:

go-tests-success:
needs:
- conditional-skip
- setup
- check-generated-deep-copy
- check-generated-protobuf
Expand All @@ -474,7 +490,7 @@ jobs:
- lint-32bit
# - go-test-arm64
- go-test-enterprise
- go-test-oss
- go-test-ce
- go-test-race
- go-test-envoyextensions
- go-test-troubleshoot
Expand All @@ -485,7 +501,7 @@ jobs:
- go-test-32bit
# - go-test-s390x
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: ${{ always() }}
if: always() && needs.conditional-skip.outputs.trigger-ci == 'true'
steps:
- name: evaluate upstream job results
run: |
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/nightly-test-1.12.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
working-directory: ./ui/packages/consul-ui
run: make test-node

frontend-build-oss:
frontend-build-ce:
runs-on: ubuntu-latest
env:
JOBS: 2
Expand All @@ -64,27 +64,27 @@ jobs:
working-directory: ./ui
run: make deps

- name: Ember Build OSS
id: build-oss
- name: Ember Build CE
id: build-ce
working-directory: ./ui/packages/consul-ui
run: make build-ci

- name: Upload OSS Frontend
- name: Upload CE Frontend
uses: actions/upload-artifact@v3
with:
name: frontend-oss-${{ env.BRANCH_NAME }}
name: frontend-ce-${{ env.BRANCH_NAME }}
path: ./ui/packages/consul-ui/dist
if-no-files-found: error

frontend-test-oss:
frontend-test-ce:
runs-on: ubuntu-latest
needs: [frontend-build-oss]
needs: [frontend-build-ce]
strategy:
matrix:
partition: [ 1, 2, 3, 4 ]
env:
CONSUL_NSPACES_ENABLED: 0
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary
EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
Expand All @@ -103,13 +103,13 @@ jobs:
working-directory: ./ui
run: make deps

- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@v3
with:
name: frontend-oss-${{ env.BRANCH_NAME }}
name: frontend-ce-${{ env.BRANCH_NAME }}
path: ./ui/packages/consul-ui/dist

- name: Ember Test OSS
- name: Ember Test CE
id: cache
working-directory: ./ui/packages/consul-ui
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
run: make deps

- name: Ember Build ENT
id: build-oss
id: build-ce
working-directory: ./ui/packages/consul-ui
run: make build-ci

Expand All @@ -156,7 +156,7 @@ jobs:
partition: [ 1, 2, 3, 4 ]
env:
CONSUL_NSPACES_ENABLED: 1
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary
EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:

slack-failure-notification:
runs-on: ubuntu-latest
needs: [frontend-test-oss, frontend-test-ent]
needs: [frontend-test-ce, frontend-test-ent]
if: ${{ failure() }}
steps:
- name: Slack Notification
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/nightly-test-1.13.x.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
working-directory: ./ui/packages/consul-ui
run: make test-node

frontend-build-oss:
frontend-build-ce:
runs-on: ubuntu-latest
env:
JOBS: 2
Expand All @@ -64,27 +64,27 @@ jobs:
working-directory: ./ui
run: make deps

- name: Ember Build OSS
id: build-oss
- name: Ember Build CE
id: build-ce
working-directory: ./ui/packages/consul-ui
run: make build-ci

- name: Upload OSS Frontend
- name: Upload CE Frontend
uses: actions/upload-artifact@v3
with:
name: frontend-oss-${{ env.BRANCH_NAME }}
name: frontend-ce-${{ env.BRANCH_NAME }}
path: ./ui/packages/consul-ui/dist
if-no-files-found: error

frontend-test-oss:
frontend-test-ce:
runs-on: ubuntu-latest
needs: [frontend-build-oss]
needs: [frontend-build-ce]
strategy:
matrix:
partition: [ 1, 2, 3, 4 ]
env:
CONSUL_NSPACES_ENABLED: 0
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary
EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
Expand All @@ -103,13 +103,13 @@ jobs:
working-directory: ./ui
run: make deps

- name: Download OSS Frontend
- name: Download CE Frontend
uses: actions/download-artifact@v3
with:
name: frontend-oss-${{ env.BRANCH_NAME }}
name: frontend-ce-${{ env.BRANCH_NAME }}
path: ./ui/packages/consul-ui/dist

- name: Ember Test OSS
- name: Ember Test CE
id: cache
working-directory: ./ui/packages/consul-ui
run: node_modules/.bin/ember exam --split=$EMBER_PARTITION_TOTAL --partition=${{ matrix.partition }} --path dist --silent -r xunit
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
run: make deps

- name: Ember Build ENT
id: build-oss
id: build-ce
working-directory: ./ui/packages/consul-ui
run: make build-ci

Expand All @@ -156,7 +156,7 @@ jobs:
partition: [ 1, 2, 3, 4 ]
env:
CONSUL_NSPACES_ENABLED: 1
EMBER_TEST_REPORT: test-results/report-oss.xml #outputs test report for CI test summary
EMBER_TEST_REPORT: test-results/report-ce.xml #outputs test report for CI test summary
EMBER_TEST_PARALLEL: true #enables test parallelization with ember-exam
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:

slack-failure-notification:
runs-on: ubuntu-latest
needs: [frontend-test-oss, frontend-test-ent]
needs: [frontend-test-ce, frontend-test-ent]
if: ${{ failure() }}
steps:
- name: Slack Notification
Expand Down
Loading

0 comments on commit 3cf0607

Please sign in to comment.