-
Notifications
You must be signed in to change notification settings - Fork 8
ci: testing some dockerfile validation and visualization #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f1988d2
ci: testing some dockerfile validation and visualization
nicklasl 259484d
ci: mermaids with colors
nicklasl 51ff07e
Potential fix for code scanning alert no. 3: Workflow does not contai…
nicklasl 8d4d309
ci: test commenting
nicklasl 194e3f9
no more comments
nicklasl f03c85b
retry comments
nicklasl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,259 @@ | ||
| { | ||
| "dependencies": { | ||
| "all": [ | ||
| "confidence-cloudflare-resolver.lint", | ||
| "confidence-resolver.lint", | ||
| "confidence-resolver.test", | ||
| "openfeature-provider-go.build", | ||
| "openfeature-provider-go.lint", | ||
| "openfeature-provider-go.test", | ||
| "openfeature-provider-go.validate-wasm", | ||
| "openfeature-provider-java.build", | ||
| "openfeature-provider-java.test", | ||
| "openfeature-provider-java.test_e2e", | ||
| "openfeature-provider-js.build", | ||
| "openfeature-provider-js.test", | ||
| "openfeature-provider-js.test_e2e", | ||
| "openfeature-provider-ruby.build", | ||
| "openfeature-provider-ruby.lint", | ||
| "openfeature-provider-ruby.test", | ||
| "python-host.test", | ||
| "wasm-msg.lint", | ||
| "wasm-msg.test", | ||
| "wasm-rust-guest.artifact", | ||
| "wasm-rust-guest.lint" | ||
| ], | ||
| "confidence-cloudflare-resolver.lint": [ | ||
| "wasm-deps" | ||
| ], | ||
| "confidence-resolver.lint": [ | ||
| "rust-test-base" | ||
| ], | ||
| "confidence-resolver.test": [ | ||
| "rust-test-base" | ||
| ], | ||
| "openfeature-provider-go-base": [ | ||
| "wasm-rust-guest.artifact" | ||
| ], | ||
| "openfeature-provider-go.build": [ | ||
| "openfeature-provider-go-base" | ||
| ], | ||
| "openfeature-provider-go.lint": [ | ||
| "openfeature-provider-go-base" | ||
| ], | ||
| "openfeature-provider-go.test": [ | ||
| "openfeature-provider-go-base" | ||
| ], | ||
| "openfeature-provider-go.validate-wasm": [ | ||
| "wasm-rust-guest.artifact" | ||
| ], | ||
| "openfeature-provider-java-base": [ | ||
| "wasm-rust-guest.artifact" | ||
| ], | ||
| "openfeature-provider-java.build": [ | ||
| "openfeature-provider-java-base" | ||
| ], | ||
| "openfeature-provider-java.publish": [ | ||
| "openfeature-provider-java.build" | ||
| ], | ||
| "openfeature-provider-java.test": [ | ||
| "openfeature-provider-java-base" | ||
| ], | ||
| "openfeature-provider-java.test_e2e": [ | ||
| "openfeature-provider-java.test" | ||
| ], | ||
| "openfeature-provider-js-base": [ | ||
| "wasm-rust-guest.artifact" | ||
| ], | ||
| "openfeature-provider-js.artifact": [ | ||
| "openfeature-provider-js.pack" | ||
| ], | ||
| "openfeature-provider-js.build": [ | ||
| "openfeature-provider-js-base" | ||
| ], | ||
| "openfeature-provider-js.pack": [ | ||
| "openfeature-provider-js.build" | ||
| ], | ||
| "openfeature-provider-js.test": [ | ||
| "openfeature-provider-js-base" | ||
| ], | ||
| "openfeature-provider-js.test_e2e": [ | ||
| "openfeature-provider-js.test" | ||
| ], | ||
| "openfeature-provider-ruby.artifact": [ | ||
| "openfeature-provider-ruby.build" | ||
| ], | ||
| "openfeature-provider-ruby.build": [ | ||
| "openfeature-provider-ruby-base" | ||
| ], | ||
| "openfeature-provider-ruby.lint": [ | ||
| "openfeature-provider-ruby-base" | ||
| ], | ||
| "openfeature-provider-ruby.publish": [ | ||
| "openfeature-provider-ruby.build" | ||
| ], | ||
| "openfeature-provider-ruby.test": [ | ||
| "openfeature-provider-ruby-base" | ||
| ], | ||
| "python-host-base": [ | ||
| "wasm-rust-guest.artifact" | ||
| ], | ||
| "python-host.test": [ | ||
| "python-host-base" | ||
| ], | ||
| "rust-deps": [ | ||
| "rust-base" | ||
| ], | ||
| "rust-test-base": [ | ||
| "rust-base", | ||
| "rust-deps" | ||
| ], | ||
| "wasm-deps": [ | ||
| "rust-base", | ||
| "rust-deps" | ||
| ], | ||
| "wasm-msg.lint": [ | ||
| "rust-test-base" | ||
| ], | ||
| "wasm-msg.test": [ | ||
| "rust-test-base" | ||
| ], | ||
| "wasm-rust-guest.artifact": [ | ||
| "wasm-rust-guest.build" | ||
| ], | ||
| "wasm-rust-guest.build": [ | ||
| "wasm-deps" | ||
| ], | ||
| "wasm-rust-guest.lint": [ | ||
| "wasm-deps" | ||
| ] | ||
| }, | ||
| "file_dependencies": { | ||
| "openfeature-provider-go-base": [ | ||
| "openfeature-provider/go/Makefile", | ||
| "openfeature-provider/go/confidence/*.go", | ||
| "openfeature-provider/go/confidence/proto", | ||
| "openfeature-provider/go/go.mod" | ||
| ], | ||
| "openfeature-provider-go.validate-wasm": [ | ||
| "openfeature-provider/go/confidence/wasm/confidence_resolver.wasm" | ||
| ], | ||
| "openfeature-provider-java-base": [ | ||
| "confidence-resolver/protos", | ||
| "openfeature-provider/java/Makefile", | ||
| "openfeature-provider/java/pom.xml", | ||
| "openfeature-provider/java/src", | ||
| "wasm/proto" | ||
| ], | ||
| "openfeature-provider-js-base": [ | ||
| "\\", | ||
| "openfeature-provider/js/Makefile", | ||
| "openfeature-provider/js/proto", | ||
| "openfeature-provider/js/src", | ||
| "openfeature-provider/js/tsconfig.json" | ||
| ], | ||
| "openfeature-provider-js.test": [ | ||
| "confidence-resolver/protos", | ||
| "openfeature-provider/js/.prettierignore", | ||
| "openfeature-provider/js/prettier.config.cjs", | ||
| "wasm/resolver_state.pb" | ||
| ], | ||
| "openfeature-provider-ruby-base": [ | ||
| "openfeature-provider/ruby/Gemfile", | ||
| "openfeature-provider/ruby/Makefile", | ||
| "openfeature-provider/ruby/Rakefile", | ||
| "openfeature-provider/ruby/confidence-openfeaure-provider.gemspec", | ||
| "openfeature-provider/ruby/lib", | ||
| "openfeature-provider/ruby/spec" | ||
| ], | ||
| "python-host-base": [ | ||
| "wasm/proto", | ||
| "wasm/python-host/*.py", | ||
| "wasm/python-host/Makefile", | ||
| "wasm/python-host/generate_proto.py", | ||
| "wasm/resolver_state.pb" | ||
| ], | ||
| "rust-base": [ | ||
| "rust-toolchain.toml" | ||
| ], | ||
| "rust-deps": [ | ||
| "Cargo.toml", | ||
| "confidence-cloudflare-resolver/Cargo.toml", | ||
| "confidence-resolver/Cargo.toml", | ||
| "confidence-resolver/build.rs", | ||
| "confidence-resolver/protos", | ||
| "openfeature-provider/go/Cargo.toml", | ||
| "openfeature-provider/java/Cargo.toml", | ||
| "openfeature-provider/js/Cargo.toml", | ||
| "wasm-msg/Cargo.toml", | ||
| "wasm-msg/build.rs", | ||
| "wasm-msg/proto", | ||
| "wasm/proto", | ||
| "wasm/rust-guest/Cargo.toml", | ||
| "wasm/rust-guest/build.rs", | ||
| "wasm/rust-guest/proto" | ||
| ], | ||
| "rust-test-base": [ | ||
| "Cargo.toml", | ||
| "confidence-cloudflare-resolver/", | ||
| "confidence-resolver/", | ||
| "openfeature-provider/go/Cargo.toml", | ||
| "openfeature-provider/java/Cargo.toml", | ||
| "openfeature-provider/js/Cargo.toml", | ||
| "wasm-msg/", | ||
| "wasm/proto/", | ||
| "wasm/rust-guest/" | ||
| ], | ||
| "wasm-deps": [ | ||
| "Cargo.toml", | ||
| "confidence-cloudflare-resolver/", | ||
| "confidence-resolver/", | ||
| "data/", | ||
| "openfeature-provider/go/Cargo.toml", | ||
| "openfeature-provider/java/Cargo.toml", | ||
| "openfeature-provider/js/Cargo.toml", | ||
| "wasm-msg/", | ||
| "wasm/proto/", | ||
| "wasm/rust-guest/" | ||
| ] | ||
| }, | ||
| "stages": { | ||
| "all": "scratch", | ||
| "confidence-cloudflare-resolver.lint": "wasm-deps", | ||
| "confidence-resolver.lint": "rust-test-base", | ||
| "confidence-resolver.test": "rust-test-base", | ||
| "openfeature-provider-go-base": "golang:1.24-alpine", | ||
| "openfeature-provider-go.build": "openfeature-provider-go-base", | ||
| "openfeature-provider-go.lint": "openfeature-provider-go-base", | ||
| "openfeature-provider-go.test": "openfeature-provider-go-base", | ||
| "openfeature-provider-go.validate-wasm": "alpine:3.22", | ||
| "openfeature-provider-java-base": "eclipse-temurin:17-jdk", | ||
| "openfeature-provider-java.build": "openfeature-provider-java-base", | ||
| "openfeature-provider-java.publish": "openfeature-provider-java.build", | ||
| "openfeature-provider-java.test": "openfeature-provider-java-base", | ||
| "openfeature-provider-java.test_e2e": "openfeature-provider-java.test", | ||
| "openfeature-provider-js-base": "node:20-alpine", | ||
| "openfeature-provider-js.artifact": "scratch", | ||
| "openfeature-provider-js.build": "openfeature-provider-js-base", | ||
| "openfeature-provider-js.pack": "openfeature-provider-js.build", | ||
| "openfeature-provider-js.test": "openfeature-provider-js-base", | ||
| "openfeature-provider-js.test_e2e": "openfeature-provider-js.test", | ||
| "openfeature-provider-ruby-base": "ruby:3.3-alpine", | ||
| "openfeature-provider-ruby.artifact": "scratch", | ||
| "openfeature-provider-ruby.build": "openfeature-provider-ruby-base", | ||
| "openfeature-provider-ruby.lint": "openfeature-provider-ruby-base", | ||
| "openfeature-provider-ruby.publish": "openfeature-provider-ruby.build", | ||
| "openfeature-provider-ruby.test": "openfeature-provider-ruby-base", | ||
| "python-host-base": "python:3.11-slim", | ||
| "python-host.test": "python-host-base", | ||
| "rust-base": "alpine:3.22", | ||
| "rust-deps": "rust-base", | ||
| "rust-test-base": "rust-base", | ||
| "wasm-deps": "rust-base", | ||
| "wasm-msg.lint": "rust-test-base", | ||
| "wasm-msg.test": "rust-test-base", | ||
| "wasm-rust-guest.artifact": "scratch", | ||
| "wasm-rust-guest.build": "wasm-deps", | ||
| "wasm-rust-guest.lint": "wasm-deps" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Dockerfile Dependency Validation | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - 'Dockerfile' | ||
| - '.dockerfile-deps.json' | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| validate-dockerfile-deps: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Validate Dockerfile dependencies | ||
| id: validate | ||
| run: | | ||
| set +e | ||
| python3 tools/dockerfile-deps.py --validate > report.md | ||
| EXIT_CODE=$? | ||
| echo "exit_code=$EXIT_CODE" >> $GITHUB_OUTPUT | ||
| exit 0 | ||
|
|
||
| - name: Add report to job summary | ||
| if: always() | ||
| run: | | ||
| cat report.md >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| - name: Comment on PR with changes | ||
| if: steps.validate.outputs.exit_code != '0' && github.event_name == 'pull_request' | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const fs = require('fs'); | ||
| const report = fs.readFileSync('report.md', 'utf8'); | ||
|
|
||
| // Extract only the validation sections | ||
| const lines = report.split('\n'); | ||
| let output = []; | ||
| let inValidationSection = false; | ||
| let foundBuildOrder = false; | ||
|
|
||
| for (const line of lines) { | ||
| if (line.startsWith('## Build Order') || line.startsWith('## Dependency Graph')) { | ||
| foundBuildOrder = true; | ||
| break; | ||
| } | ||
| if (line.startsWith('# Dockerfile Dependency Analysis') || | ||
| line.startsWith('**Dockerfile:**') || | ||
| line.startsWith('**Total Stages:**')) { | ||
| output.push(line); | ||
| continue; | ||
| } | ||
| if (line.startsWith('## Source of Truth Validation') || | ||
| line.startsWith('## Topological Validation')) { | ||
| inValidationSection = true; | ||
| } | ||
| if (inValidationSection) { | ||
| output.push(line); | ||
| } | ||
| } | ||
|
|
||
| const shortReport = output.join('\n').trim(); | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: `${shortReport}\n\n---\n*This check ensures Dockerfile dependencies are tracked and validated against the source of truth.*` | ||
| }); | ||
|
|
||
| - name: Fail if validation failed | ||
| if: steps.validate.outputs.exit_code != '0' | ||
| run: | | ||
| echo "::error::Dockerfile dependencies validation failed. See job summary for details." | ||
| exit 1 | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.