Skip to content

Commit 47cedfa

Browse files
authored
Merge branch 'main' into ci/security-scanning
2 parents fb33c26 + 0df468a commit 47cedfa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1147
-938
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ Fixes #(issue number)
1515

1616
## Checklist
1717

18-
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) guide
18+
- [ ] I have read the [CONTRIBUTING](CONTRIBUTING.md) guide
1919
- [ ] My code follows the existing code style
2020
- [ ] I have added tests that prove my fix/feature works
2121
- [ ] I have updated documentation as needed
2222
- [ ] All new and existing tests pass (`make test`)
23-
- [ ] I have run the linter (`make lint`)
23+
- [ ] I have run the linter (`make format`)
2424

2525
## Testing
2626

.github/workflows/acceptance-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ jobs:
9494

9595
- name: Run Acceptance Tests
9696
env:
97-
ORY_KETO_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_keto_tests == 'true' }}
98-
ORY_B2B_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_b2b_tests == 'true' }}
99-
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_social_provider_tests == 'true' }}
100-
ORY_SCHEMA_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_schema_tests == 'true' }}
101-
ORY_PROJECT_TESTS_ENABLED: ${{ github.event_name == 'push' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_project_tests == 'true' }}
97+
ORY_KETO_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_keto_tests == 'true' }}
98+
ORY_B2B_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_b2b_tests == 'true' }}
99+
ORY_SOCIAL_PROVIDER_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_social_provider_tests == 'true' }}
100+
ORY_SCHEMA_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_schema_tests == 'true' }}
101+
ORY_PROJECT_TESTS_ENABLED: ${{ github.event_name == 'pull_request' || github.event.inputs.run_all == 'true' || github.event.inputs.enable_project_tests == 'true' }}
102102
run: ./scripts/run-acceptance-tests.sh -v -timeout 20m ./...
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Validation - Conventional commits
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- edited
7+
- opened
8+
- ready_for_review
9+
- reopened
10+
11+
permissions:
12+
contents: read
13+
pull-requests: write
14+
15+
jobs:
16+
main:
17+
name: Validate PR title
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
steps:
21+
- uses: amannn/action-semantic-pull-request@v5
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
with:
25+
types: |
26+
feat
27+
fix
28+
docs
29+
style
30+
refactor
31+
perf
32+
test
33+
build
34+
ci
35+
chore
36+
revert
37+
requireScope: false
38+
subjectPattern: ^(?![A-Z]).+$
39+
subjectPatternError: |
40+
The subject should start with a lowercase letter, yours is uppercase:
41+
"{subject}"

.github/workflows/lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
format:
12+
name: Format
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 10
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: actions/setup-go@v5
19+
with:
20+
go-version-file: 'go.mod'
21+
cache: true
22+
23+
- uses: hashicorp/setup-terraform@v3
24+
with:
25+
terraform_wrapper: false
26+
27+
- run: make format
28+
29+
- name: Check for changes
30+
run: git diff HEAD --exit-code --color

.github/workflows/renovate.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Renovate
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
# https://crontab.guru/#0_8,11,14,17_*_*_*
7+
- cron: '0 8,11,14,17 * * *'
8+
9+
concurrency:
10+
group: renovate-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
renovate:
15+
name: Run Renovate
16+
runs-on: ubuntu-slim
17+
timeout-minutes: 30
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Self-hosted Renovate
23+
uses: renovatebot/github-action@v44.2.5
24+
with:
25+
configurationFile: 'renovate-self-hosted.json'
26+
env-regex: "^(?:RENOVATE_\\w+|LOG_LEVEL|GITHUB_COM_TOKEN|NODE_OPTIONS|AWS_TOKEN)$"
27+
token: '${{ secrets.ORY_BOT_PAT }}'

.github/workflows/unit-test.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Unit Tests
22

33
on:
4-
push:
5-
branches: [main]
64
pull_request:
75
branches: [main]
86

.golangci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
version: "2"
2+
3+
run:
4+
timeout: 5m
5+
modules-download-mode: readonly
6+
7+
linters:
8+
default: standard
9+
enable:
10+
# Additional recommended linters
11+
- bodyclose # Check HTTP response body is closed
12+
- dogsled # Check for too many blank identifiers
13+
- dupl # Check for duplicated code
14+
- errorlint # Check error wrapping
15+
- exhaustive # Check exhaustiveness of enum switch statements
16+
- gochecknoinits # Check for init functions
17+
- goconst # Find repeated strings that could be constants
18+
- gocritic # Opinionated linter
19+
- goprintffuncname # Check printf-like function names
20+
- gosec # Security checks
21+
- misspell # Check for misspelled English words
22+
- nilerr # Check for nil error returns
23+
- noctx # Check for HTTP requests without context
24+
- prealloc # Find slice declarations that could be preallocated
25+
- unconvert # Remove unnecessary type conversions
26+
- unparam # Find unused function parameters
27+
- whitespace # Check for unnecessary whitespace
28+
29+
disable:
30+
# Disabled for Terraform providers - these implement framework interfaces
31+
- revive
32+
33+
settings:
34+
dupl:
35+
threshold: 150
36+
37+
exhaustive:
38+
default-signifies-exhaustive: true
39+
40+
goconst:
41+
min-len: 3
42+
min-occurrences: 3
43+
44+
gocritic:
45+
disabled-checks:
46+
- ifElseChain # Sometimes clearer than switch
47+
48+
misspell:
49+
locale: US
50+
51+
exclusions:
52+
presets:
53+
- std-error-handling
54+
- common-false-positives
55+
rules:
56+
# Test files have repetitive patterns and don't need strict error handling
57+
- path: _test\.go
58+
linters:
59+
- dupl
60+
- goconst
61+
- errorlint
62+
63+
- path: internal/resources/
64+
linters:
65+
- dupl
66+
67+
- path: internal/datasources/
68+
linters:
69+
- dupl
70+
71+
formatters:
72+
enable:
73+
- gofmt
74+
- goimports
75+
settings:
76+
gofmt:
77+
simplify: true
78+
goimports:
79+
local-prefixes:
80+
- github.com/ory/terraform-provider-orynetwork
81+
82+
output:
83+
show-stats: true

Makefile

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,21 @@ clean: ## Remove build artifacts
5555
# CODE QUALITY
5656
# ==============================================================================
5757

58-
.PHONY: fmt
59-
fmt: ## Format Go code
58+
.PHONY: format
59+
format: ## Format all code (Go, Terraform, modules, docs, lint fixes)
6060
go fmt ./...
6161
gofmt -s -w .
62+
terraform fmt -recursive examples/
63+
go mod tidy
64+
@command -v tfplugindocs >/dev/null 2>&1 || { echo "Installing tfplugindocs..."; go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs@latest; }
65+
tfplugindocs generate --provider-name ory
66+
@command -v golangci-lint >/dev/null 2>&1 || { echo "Installing golangci-lint v2..."; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest; }
67+
golangci-lint run --fix ./...
6268

6369
.PHONY: lint
64-
lint: ## Run linter
70+
lint: ## Run Go linter (without fixes)
6571
golangci-lint run ./...
6672

67-
.PHONY: vet
68-
vet: ## Run go vet
69-
go vet ./...
70-
71-
.PHONY: generate
72-
generate: ## Generate documentation and code
73-
go generate ./...
74-
75-
.PHONY: check
76-
check: fmt vet lint ## Run all code quality checks
77-
7873
# ==============================================================================
7974
# TESTING
8075
# ==============================================================================

docs/data-sources/project.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
page_title: "ory_project Data Source - Ory"
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "ory_project Data Source - ory"
34
subcategory: ""
45
description: |-
56
Fetches information about an Ory project.
67
---
78

89
# ory_project (Data Source)
910

10-
Fetches information about an Ory project. Use this data source to read project details without managing the project lifecycle.
11+
Fetches information about an Ory project.
1112

1213
## Example Usage
1314

14-
### Read Current Project
15-
1615
```terraform
17-
# Read the project configured in the provider
16+
# Read the current project (from provider config)
1817
data "ory_project" "current" {}
1918
2019
output "project_name" {
@@ -24,25 +23,27 @@ output "project_name" {
2423
output "project_slug" {
2524
value = data.ory_project.current.slug
2625
}
27-
```
2826
29-
### Read Specific Project
27+
output "project_state" {
28+
value = data.ory_project.current.state
29+
}
3030
31-
```terraform
31+
# Read a specific project by ID
3232
data "ory_project" "other" {
3333
id = "other-project-uuid"
3434
}
3535
```
3636

37+
<!-- schema generated by tfplugindocs -->
3738
## Schema
3839

3940
### Optional
4041

41-
- `id` (String) - Project ID to look up. If not specified, uses the provider's project_id.
42+
- `id` (String) Project ID to look up. If not specified, uses the provider's project_id.
4243

4344
### Read-Only
4445

45-
- `name` (String) - The project name.
46-
- `slug` (String) - The project slug.
47-
- `state` (String) - The project state.
48-
- `workspace_id` (String) - The workspace ID the project belongs to.
46+
- `name` (String) The project name.
47+
- `slug` (String) The project slug.
48+
- `state` (String) The project state.
49+
- `workspace_id` (String) The workspace ID the project belongs to.

0 commit comments

Comments
 (0)