Skip to content

Commit

Permalink
Run prettier on the pipeline yaml files (#2979)
Browse files Browse the repository at this point in the history
* move prettierrc up one level

* add a prettierignore

* update files
  • Loading branch information
hawkowl authored Aug 1, 2023
1 parent 940e5a0 commit ede320d
Show file tree
Hide file tree
Showing 19 changed files with 548 additions and 537 deletions.
37 changes: 19 additions & 18 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,31 @@ run:

issues:
exclude-rules:
- linters:
- staticcheck
text: "SA1019: codec.BasicHandle is deprecated"
# This is set to false to disregard the default EXC0011 exclusion
# which shadows all the ST* checks. Refer https://github.com/golangci/golangci-lint/issues/2281
- path: "pkg/client/(.+)\\.go"
linters:
- importas
- path: "(.+/)?zz_generated_(.+)\\.go"
linters:
- importas
- path: "pkg/operator/(clientset|mocks)/(.+)\\.go"
linters:
- importas
- path: "pkg/util/mocks/(.+)\\.go"
linters:
- importas
- linters:
- staticcheck
text: "SA1019: codec.BasicHandle is deprecated"
# This is set to false to disregard the default EXC0011 exclusion
# which shadows all the ST* checks. Refer https://github.com/golangci/golangci-lint/issues/2281
- path: "pkg/client/(.+)\\.go"
linters:
- importas
- path: "(.+/)?zz_generated_(.+)\\.go"
linters:
- importas
- path: "pkg/operator/(clientset|mocks)/(.+)\\.go"
linters:
- importas
- path: "pkg/util/mocks/(.+)\\.go"
linters:
- importas
exclude-use-default: false

linters-settings:
stylecheck:
# added additional checks for comments in Go.
# Refer https://staticcheck.io/docs/options#checks for details
checks: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
checks:
["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
dot-import-whitelist:
- github.com/onsi/ginkgo/v2
- github.com/onsi/gomega
Expand Down
202 changes: 101 additions & 101 deletions .pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,132 +15,132 @@
trigger:
branches:
include:
- master
- master
paths:
exclude:
- docs/*
- docs/*
tags:
include:
- v2*
- v2*

pr:
branches:
include:
- master
- master
paths:
exclude:
- docs/*
- docs/*

resources:
containers:
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.18
options: --user=0
- container: python
image: registry.access.redhat.com/ubi8/python-39:latest
options: --user=0
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.18
options: --user=0
- container: python
image: registry.access.redhat.com/ubi8/python-39:latest
options: --user=0

variables:
- template: vars.yml
- template: vars.yml

jobs:
- job: Golang_CodeQL
pool:
name: 1es-aro-ci-pool
variables:
HOME: $(Agent.BuildDirectory)
steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-codeql.yml
parameters:
language: go
target: golang
github_token: $(github_codeql_upload_token)
timeoutInMinutes: 120
- job: Golang_CodeQL
pool:
name: 1es-aro-ci-pool
variables:
HOME: $(Agent.BuildDirectory)
steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-codeql.yml
parameters:
language: go
target: golang
github_token: $(github_codeql_upload_token)
timeoutInMinutes: 120

- job: Python_Unit_Tests
pool:
name: 1es-aro-ci-pool
variables:
HOME: $(Agent.BuildDirectory)
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make test-python
[[ -z "$(git status -s)" ]]
displayName: 🧪Run Python Unit Tests
target: python
- job: Python_Unit_Tests
pool:
name: 1es-aro-ci-pool
variables:
HOME: $(Agent.BuildDirectory)
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make test-python
[[ -z "$(git status -s)" ]]
displayName: 🧪Run Python Unit Tests
target: python
- job: Golang_Unit_Tests
pool:
name: 1es-aro-ci-pool
variables:
GOCACHE: /tmp/gocache
steps:
- template: ./templates/template-checkout.yml
- job: Golang_Unit_Tests
pool:
name: 1es-aro-ci-pool
variables:
GOCACHE: /tmp/gocache
steps:
- template: ./templates/template-checkout.yml

- script: |
set -xe
go version
go env
displayName: Print Go version & env
target: golang
- script: |
set -xe
go version
go env
displayName: Print Go version & env
target: golang
- script: |
set -xe
make generate
[[ -z "$(git status -s)" ]]
displayName: ⚙️ Run Golang code generate
target: golang
- script: |
set -xe
make generate
[[ -z "$(git status -s)" ]]
displayName: ⚙️ Run Golang code generate
target: golang
- script: |
set -xe
make build-all
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Build Golang code
target: golang
- script: |
set -xe
make build-all
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Build Golang code
target: golang
- script: |
set -xe
make unit-test-go
displayName: 🧪 Run Golang unit tests
target: golang
- script: |
set -xe
make unit-test-go
displayName: 🧪 Run Golang unit tests
target: golang
- script: |
set -xe
make validate-fips
displayName: 🕵️ Validate FIPS
target: golang
- script: |
set -xe
make validate-fips
displayName: 🕵️ Validate FIPS
target: golang
- task: PublishTestResults@2
displayName: 📊 Publish tests results
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
condition: succeededOrFailed()
- task: PublishTestResults@2
displayName: 📊 Publish tests results
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
condition: succeededOrFailed()

- script: |
set -xe
go run github.com/axw/gocov/[email protected] convert cover.out | go run github.com/AlekSi/[email protected] > coverage.xml
displayName: ⚙️ Process Reports
condition: succeededOrFailed()
target: golang
- script: |
set -xe
go run github.com/axw/gocov/[email protected] convert cover.out | go run github.com/AlekSi/[email protected] > coverage.xml
displayName: ⚙️ Process Reports
condition: succeededOrFailed()
target: golang
- task: PublishCodeCoverageResults@1
displayName: 📈 Publish code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
failIfCoverageEmpty: false
condition: succeededOrFailed()
target: golang
- task: PublishCodeCoverageResults@1
displayName: 📈 Publish code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
failIfCoverageEmpty: false
condition: succeededOrFailed()
target: golang

- job: Lint_Admin_Portal
pool:
name: 1es-aro-ci-pool
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make lint-admin-portal
displayName: 🧹 Lint Admin Portal
- job: Lint_Admin_Portal
pool:
name: 1es-aro-ci-pool
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make lint-admin-portal
displayName: 🧹 Lint Admin Portal
40 changes: 20 additions & 20 deletions .pipelines/clean-subscription.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@ trigger: none
pr: none

parameters:
- name: dryRun
type: boolean
default: false
- name: dryRun
type: boolean
default: false

resources:
containers:
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.18
options: --user=0
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.18
options: --user=0

variables:
- template: vars.yml
- template: vars.yml

jobs:
- job: Clean_subscription
pool:
name: 1es-aro-ci-pool
- job: Clean_subscription
pool:
name: 1es-aro-ci-pool

steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-clean-subscription.yml
parameters:
dryRun: ${{ parameters.dryRun }}
subscriptionCredentialsJSON: $(aro-v4-e2e-devops-spn)
subscriptionId: $(subscriptionId)
purgeCreatedTag: $(purgeCreatedTag)
resourceGroupDeletePrefixes: $(resourceGroupDeletePrefixes)
purgeTTL: $(purgeTTL)
steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-clean-subscription.yml
parameters:
dryRun: ${{ parameters.dryRun }}
subscriptionCredentialsJSON: $(aro-v4-e2e-devops-spn)
subscriptionId: $(subscriptionId)
purgeCreatedTag: $(purgeCreatedTag)
resourceGroupDeletePrefixes: $(resourceGroupDeletePrefixes)
purgeTTL: $(purgeTTL)
36 changes: 18 additions & 18 deletions .pipelines/deploy-dev-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ trigger: none
pr: none

variables:
- template: vars.yml
- template: vars.yml

jobs:
- job: Deploy_new_shared_env
pool:
name: 1es-aro-ci-pool
- job: Deploy_new_shared_env
pool:
name: 1es-aro-ci-pool

steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-az-cli-login.yml
parameters:
azureDevOpsJSONSPN: $(aro-v4-e2e-devops-spn)
- script: |
export SECRET_SA_ACCOUNT_NAME=$(SECRET_SA_ACCOUNT_NAME)
make secrets
displayName: 🔑 Downloading certificates and secrets from storage account
- template: ./templates/template-deploy-shared-env.yml
parameters:
subscriptionID: $(AZURE_SUBSCRIPTION_ID)
azureDevOpsJSONSPN: $(aro-v4-e2e-devops-spn)
- template: ./templates/template-az-cli-logout.yml
steps:
- template: ./templates/template-checkout.yml
- template: ./templates/template-az-cli-login.yml
parameters:
azureDevOpsJSONSPN: $(aro-v4-e2e-devops-spn)
- script: |
export SECRET_SA_ACCOUNT_NAME=$(SECRET_SA_ACCOUNT_NAME)
make secrets
displayName: 🔑 Downloading certificates and secrets from storage account
- template: ./templates/template-deploy-shared-env.yml
parameters:
subscriptionID: $(AZURE_SUBSCRIPTION_ID)
azureDevOpsJSONSPN: $(aro-v4-e2e-devops-spn)
- template: ./templates/template-az-cli-logout.yml
Loading

0 comments on commit ede320d

Please sign in to comment.