Skip to content

Commit 111a384

Browse files
initial commit
0 parents  commit 111a384

File tree

80 files changed

+11060
-0
lines changed

Some content is hidden

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

80 files changed

+11060
-0
lines changed

.editorconfig

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# EditorConfig helps maintain consistent coding styles
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_style = tab
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
indent_style = space
15+
indent_size = 2
16+
trim_trailing_whitespace = false
17+
18+
[*.yml]
19+
indent_style = space
20+
indent_size = 2
21+
22+
[*.yaml]
23+
indent_style = space
24+
indent_size = 2
25+
26+
[*.json]
27+
indent_style = space
28+
indent_size = 2
29+
30+
[Makefile]
31+
indent_style = tab
32+
33+
[GNUmakefile]
34+
indent_style = tab

.githooks/pre-commit

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
# Pre-commit hook for terraform-provider-orynetwork
3+
4+
set -e
5+
6+
echo "Running pre-commit checks..."
7+
8+
# Format check
9+
echo "Checking formatting..."
10+
if [ -n "$(gofmt -l .)" ]; then
11+
echo "Error: The following files are not formatted:"
12+
gofmt -l .
13+
echo ""
14+
echo "Run 'make fmt' to fix formatting."
15+
exit 1
16+
fi
17+
18+
# Vet
19+
echo "Running go vet..."
20+
go vet ./...
21+
22+
# Lint
23+
echo "Running golangci-lint..."
24+
if command -v golangci-lint &> /dev/null; then
25+
golangci-lint run
26+
elif [ -x "$(go env GOPATH)/bin/golangci-lint" ]; then
27+
"$(go env GOPATH)/bin/golangci-lint" run
28+
else
29+
echo "Warning: golangci-lint not found, skipping. Install with: make tools"
30+
fi
31+
32+
# Build check
33+
echo "Checking build..."
34+
go build ./...
35+
36+
echo "All pre-commit checks passed!"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug with the Ory Terraform Provider
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Terraform Configuration
14+
15+
```hcl
16+
# Paste relevant Terraform configuration here
17+
# Remember to remove any sensitive values!
18+
```
19+
20+
## Expected Behavior
21+
22+
What you expected to happen.
23+
24+
## Actual Behavior
25+
26+
What actually happened.
27+
28+
## Steps to Reproduce
29+
30+
1. Run `terraform init`
31+
2. Run `terraform apply`
32+
3. See error
33+
34+
## Error Output
35+
36+
```
37+
# Paste error output here
38+
```
39+
40+
## Environment
41+
42+
- Terraform version: [e.g., 1.6.0]
43+
- Provider version: [e.g., 0.1.0]
44+
- OS: [e.g., macOS 14.0]
45+
46+
## Additional Context
47+
48+
Add any other context about the problem here.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like.
12+
13+
## Use Case
14+
15+
Describe the problem you're trying to solve or the workflow you're trying to enable.
16+
17+
## Proposed Solution
18+
19+
If you have ideas on how this could be implemented, describe them here.
20+
21+
## Example Configuration
22+
23+
```hcl
24+
# If applicable, show what the Terraform configuration might look like
25+
resource "ory_new_resource" "example" {
26+
name = "example"
27+
}
28+
```
29+
30+
## Alternatives Considered
31+
32+
Describe any alternative solutions or workarounds you've considered.
33+
34+
## Additional Context
35+
36+
Add any other context, screenshots, or references here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Description
2+
3+
Brief description of the changes in this PR.
4+
5+
## Related Issues
6+
7+
Fixes #(issue number)
8+
9+
## Type of Change
10+
11+
- [ ] Bug fix (non-breaking change that fixes an issue)
12+
- [ ] New feature (non-breaking change that adds functionality)
13+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
14+
- [ ] Documentation update
15+
16+
## Checklist
17+
18+
- [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) guide
19+
- [ ] My code follows the existing code style
20+
- [ ] I have added tests that prove my fix/feature works
21+
- [ ] I have updated documentation as needed
22+
- [ ] All new and existing tests pass (`make test`)
23+
- [ ] I have run the linter (`make lint`)
24+
25+
## Testing
26+
27+
Describe how you tested these changes:
28+
29+
- [ ] Unit tests
30+
- [ ] Acceptance tests
31+
- [ ] Manual testing
32+
33+
## Screenshots/Output
34+
35+
If applicable, add screenshots or command output to help explain your changes.

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright (c) Materialize Inc.
2+
3+
name: Release
4+
5+
on:
6+
push:
7+
tags:
8+
- 'v*'
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
goreleaser:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version-file: 'go.mod'
23+
cache: true
24+
- name: Import GPG key
25+
uses: crazy-max/ghaction-import-gpg@v6
26+
id: import_gpg
27+
with:
28+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
29+
passphrase: ${{ secrets.PASSPHRASE }}
30+
- name: Run GoReleaser
31+
uses: goreleaser/goreleaser-action@v5
32+
with:
33+
args: release --clean
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/test.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright (c) Materialize Inc.
2+
3+
name: Tests
4+
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 5
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-go@v5
22+
with:
23+
go-version-file: 'go.mod'
24+
cache: true
25+
- run: go mod download
26+
- run: go build -v .
27+
- name: Run linters
28+
uses: golangci/golangci-lint-action@v4
29+
with:
30+
version: latest
31+
32+
generate:
33+
name: Generate
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-go@v5
38+
with:
39+
go-version-file: 'go.mod'
40+
cache: true
41+
- run: go generate ./...
42+
- name: git diff
43+
run: |
44+
git diff --compact-summary --exit-code || \
45+
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
46+
47+
test:
48+
name: Unit Tests
49+
needs: build
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 15
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: actions/setup-go@v5
55+
with:
56+
go-version-file: 'go.mod'
57+
cache: true
58+
- run: go mod download
59+
- run: go test -v -cover ./...
60+
timeout-minutes: 10
61+
62+
# Acceptance tests run against real Ory API
63+
# Only runs on main branch or when manually triggered
64+
acceptance:
65+
name: Acceptance Tests
66+
needs: build
67+
runs-on: ubuntu-latest
68+
timeout-minutes: 30
69+
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
70+
env:
71+
ORY_WORKSPACE_API_KEY: ${{ secrets.ORY_WORKSPACE_API_KEY }}
72+
ORY_PROJECT_API_KEY: ${{ secrets.ORY_PROJECT_API_KEY }}
73+
ORY_PROJECT_ID: ${{ secrets.ORY_PROJECT_ID }}
74+
ORY_PROJECT_SLUG: ${{ secrets.ORY_PROJECT_SLUG }}
75+
steps:
76+
- uses: actions/checkout@v4
77+
- uses: actions/setup-go@v5
78+
with:
79+
go-version-file: 'go.mod'
80+
cache: true
81+
- run: go mod download
82+
- run: TF_ACC=1 go test -v -cover -timeout 30m -p 1 ./...
83+
timeout-minutes: 25

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Binaries
2+
terraform-provider-orynetwork
3+
*.exe
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary
9+
*.test
10+
11+
# Output of go coverage
12+
*.out
13+
14+
# Go workspace
15+
go.work
16+
go.work.sum
17+
18+
# IDE
19+
.idea/
20+
.vscode/
21+
*.swp
22+
*.swo
23+
*~
24+
25+
# Terraform
26+
.terraform/
27+
*.tfstate
28+
*.tfstate.*
29+
*.tfplan
30+
31+
# goreleaser
32+
dist/
33+
34+
# Local .env files
35+
.env
36+
.env.*
37+
38+
# OS files
39+
.DS_Store
40+
Thumbs.db

.golangci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (c) MaterializeLabs
2+
3+
run:
4+
timeout: 5m
5+
modules-download-mode: readonly
6+
7+
linters:
8+
enable:
9+
- gofmt
10+
- gosimple
11+
- govet
12+
- ineffassign
13+
- misspell
14+
- staticcheck
15+
- unconvert
16+
- unparam
17+
- unused
18+
19+
linters-settings:
20+
misspell:
21+
locale: US
22+
23+
issues:
24+
exclude-rules:
25+
# Exclude some linters from running on tests files
26+
- path: _test\.go
27+
linters:
28+
- unparam

0 commit comments

Comments
 (0)