Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into aaron/oidc-embedded
Browse files Browse the repository at this point in the history
  • Loading branch information
aabchoo committed Jan 30, 2025
2 parents 084c75d + eb0e909 commit 6f9c479
Show file tree
Hide file tree
Showing 54 changed files with 1,249 additions and 685 deletions.
4 changes: 3 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ translate text from English to Spanish.
-->

**Related Issues/PRs (if applicable)**:

<!--
Please add the related issues or PRs here.
Example:
Fixes #12345
Close #12346
Related PR: #12347
Expand Down Expand Up @@ -44,7 +46,7 @@ Also, please make sure that you can check off all the items on the checklist bel
Otherwise, you might unnecessarily consume the time of the maintainers unless there's
a specific reason for not doing so.
**Checklist**:
**Checklist** (you don't need to keep in your PR description):
- [ ] The PR title follows the same format as the merged PRs.
- [ ] I have read the [CONTRIBUTING.md](../CONTRIBUTING.md) (for first-time contributors).
- [ ] I have made sure that `make precommit test` passes locally.
Expand Down
52 changes: 0 additions & 52 deletions .github/workflows/doctest.yaml

This file was deleted.

36 changes: 33 additions & 3 deletions .github/workflows/pr_title_check.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Lint PR title
name: PR Style Check

on:
pull_request_target:
Expand All @@ -7,9 +7,34 @@ on:
- edited
- synchronize

permissions:
contents: read

jobs:
main:
name: Validate PR title
description:
name: Description
runs-on: ubuntu-latest
steps:
- name: Check PR description
env:
# Do noe use ${{ github.event.pull_request.body }} directly in run command.
TITLE: ${{ github.event.pull_request.body }}
run: |
if [[ $TITLE =~ "<!--" ]]; then
echo "PR description contains '<!--'. Please remove all the comment out lines in the template after carefully reading them."
exit 1
fi
if [[ $TITLE =~ "-->" ]]; then
echo "PR description contains '-->'. Please remove all the comment out lines in the template after carefully reading them."
exit 1
fi
if [[ ! $TITLE =~ "**Commit Message**:" ]]; then
echo "PR description must begin with '**Commit Message**:'."
exit 1
fi
title:
name: Title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
Expand All @@ -33,3 +58,8 @@ jobs:
controller
translator
examples
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
30 changes: 30 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Style
on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
style:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Run code style check
run: make check
35 changes: 12 additions & 23 deletions .github/workflows/commit.yaml → .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
name: Commit
name: Tests
on:
pull_request:
branches:
- main
paths-ignore:
- '**/*.md'
- 'site/**'
- 'netlify.toml'

push:
branches:
- main
paths-ignore:
- '**/*.md'
- 'site/**'
- 'netlify.toml'

# If the PR is coming from a fork, they are not allowed to access secrets by default.
# This even is triggered only if the PR gets labeled with 'safe to test' which can only be added by the maintainers.
# Jobs do not use secrets in the workflow will ignore this event.
Expand All @@ -20,27 +30,6 @@ concurrency:
cancel-in-progress: true

jobs:
style:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Code Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
cache: false
go-version-file: go.mod
- uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: code-style-check-${{ hashFiles('**/go.mod', '**/go.sum', '**/Makefile') }}
- name: Run code style check
run: make check

unittest:
if: github.event_name == 'pull_request' || github.event_name == 'push'
name: Unit Test
Expand Down Expand Up @@ -193,7 +182,7 @@ jobs:
# Docker builds are verified in test_e2e job, so we only need to push the images when the event is a push event.
if: github.event_name == 'push'
name: Push Docker Images
needs: [style, unittest, test_cel_validation, test_controller, test_extproc, test_e2e]
needs: [unittest, test_cel_validation, test_controller, test_extproc, test_e2e]
uses: ./.github/workflows/docker_builds_template.yaml

push_helm:
Expand Down
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,20 @@ help:
@echo " test Run the unit tests for the codebase."
@echo " test-cel Run the integration tests of CEL validation rules in API definitions with envtest."
@echo " This will be needed when changing API definitions."
@echo " test-doctest Run the integration tests for documentation site."
@echo " test-extproc Run the integration tests for extproc without controller or k8s at all."
@echo " test-controller Run the integration tests for the controller with envtest."
@echo " test-e2e Run the end-to-end tests with a local kind cluster."
@echo ""
@echo "For example, 'make precommit test' should be enough for initial iterations, and later 'make test-cel' etc. for the normal development cycle."
@echo "Note that some cases run by test-e2e, test-extproc, and test-doctest use credentials and these will be skipped when not available."
@echo "Note that some cases run by test-e2e or test-extproc use credentials and these will be skipped when not available."
@echo ""
@echo ""

# This runs the linter, formatter, and tidy on the codebase.
.PHONY: lint
lint: golangci-lint
@echo "lint => ./..."
@$(GOLANGCI_LINT) run --build-tags==test_cel_validation,test_controller,test_extproc,test_doctest ./...
@$(GOLANGCI_LINT) run --build-tags==test_cel_validation,test_controller,test_extproc ./...

.PHONY: codespell
CODESPELL_SKIP := $(shell cat .codespell.skip | tr \\n ',')
Expand Down Expand Up @@ -163,14 +162,6 @@ test-e2e: kind
@echo "Run E2E tests"
@go test ./tests/e2e/... $(GO_TEST_ARGS) $(GO_TEST_E2E_ARGS) -tags test_e2e

# This runs the integration tests for the documentation site.
#
# The dependencies for this target depends on the test case being run.
.PHONY: test-doctest
test-doctest: kind
@echo "Run doctest"
@go test ./tests/doctest/... $(GO_TEST_ARGS) $(GO_TEST_E2E_ARGS) -tags test_doctest

# This builds a binary for the given command under the internal/cmd directory.
#
# Example:
Expand Down
2 changes: 1 addition & 1 deletion cmd/controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func main() {
}()

// Start the controller.
if err := controller.StartControllers(ctx, k8sConfig, setupLog, options); err != nil {
if err := controller.StartControllers(ctx, k8sConfig, ctrl.Log.WithName("controller"), options); err != nil {
setupLog.Error(err, "failed to start controller")
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6f9c479

Please sign in to comment.