Skip to content

Add workflows. Update atmos terraform shell - #128

Merged
Andriy Knysh (aknysh) merged 13 commits into
masterfrom
update-8
Mar 11, 2022
Merged

Andriy Knysh (aknysh) merged 13 commits into
masterfrom
update-8

Conversation

@aknysh

@aknysh Andriy Knysh (aknysh) commented Mar 10, 2022 •

Copy link
Copy Markdown
Member

what

  • Add workflows
  • Define workflows in YAML
  • Support two types of workflows: atmos and shell
  • Allow specifying the atmos stack in 3 different ways:
    • on the command line in the command attribute in the workflow steps
    • as stack attribute in each workflow step
    • as stack attribute in the workflow itself
  • Update atmos terraform shell command

why

  • Allow sequential execution of atmos and shell commands
  • Update atmos terraform shell command to use the bash shell by default on Unix systems if the SHELL ENV var is not defined

test

atmos workflow test-1 -f workflow1
Executing the workflow 'test-1' from 'examples/complete/workflows/workflow1.yaml'

description: Test workflow
steps:
- command: echo Command 1
  stack: ""
  type: shell
- command: echo Command 2
  stack: ""
  type: shell
- command: echo Command 3
  stack: ""
  type: shell
- command: echo Command 4
  stack: ""
  type: shell
- command: echo Command 5
  stack: ""
  type: shell
stack: ""


Executing workflow step: echo Command 1

Executing command:
/bin/echo Command 1
Command 1

Executing workflow step: echo Command 2

Executing command:
/bin/echo Command 2
Command 2

Executing workflow step: echo Command 3

Executing command:
/bin/echo Command 3
Command 3

Executing workflow step: echo Command 4

Executing command:
/bin/echo Command 4
Command 4

Executing workflow step: echo Command 5

Executing command:
/bin/echo Command 5
Command 5


atmos workflow -f workflow1 terraform-plan-all-tenant1-ue2-dev
Executing workflow step: terraform plan test/test-component-override-2
Stack: tenant1-ue2-dev

Executing command:
/Users/andriyknysh/Documents/Projects/Go/bin/atmos terraform plan test/test-component-override-2 -s tenant1-ue2-dev

Variables for the component 'test/test-component-override-2' in the stack 'tenant1/ue2/dev':

enabled: true
environment: ue2
namespace: eg
region: us-east-2
service_1_list:

@aknysh Andriy Knysh (aknysh) changed the title Add workflows Add workflows. Update atmos terraform shell Mar 10, 2022
@aknysh
Andriy Knysh (aknysh) merged commit c9c63b0 into master Mar 11, 2022
@aknysh
Andriy Knysh (aknysh) deleted the update-8 branch March 11, 2022 15:46
Erik Osterman (Cloud Posse) (osterman) added a commit that referenced this pull request Oct 21, 2025
## What Changed

- **Removed** custom .github/actions/license-check/ action (264 lines of brittle bash)
- **Removed** custom .github/workflows/license-check.yml workflow (44 lines)
- **Added** GitHub's native dependency-review-action workflow
- **Updated** scripts/README.md to document new approach

## Why This Is Better

**Reliability:**
- No more fighting with go-licenses stdlib errors (issue #128)
- No more grep -c edge cases with duplicate zeros
- No more GitHub Actions output format errors
- GitHub's license data from ClearlyDefined (industry standard)

**Simplicity:**
- 18 lines of workflow vs 308 lines of custom code
- Zero maintenance burden - GitHub maintains the action
- Works across all ecosystems, not just Go

**Functionality:**
- Still validates licenses on every PR
- Still blocks copyleft/restrictive licenses (GPL, LGPL, AGPL)
- Still checks for security vulnerabilities
- Automatically comments on PRs with details

## NOTICE File Generation

The NOTICE file remains in the repository and is updated manually using:
```bash
./scripts/generate-notice.sh
```

This is intentional to:
- Allow human review of license changes
- Keep file stable across builds
- Separate validation (automated) from documentation (manual)

## Migration Notes

License compliance is now enforced by GitHub's native dependency graph
rather than running go-licenses in CI. This is more reliable and requires
zero custom code to maintain.
Erik Osterman (Cloud Posse) (osterman) added a commit that referenced this pull request Oct 21, 2025
)

* Changes auto-committed by Conductor

* fix: handle go-licenses stdlib errors gracefully

go-licenses v1.6.0 fails when encountering stdlib packages without module info.
This is a known issue (google/go-licenses#128) but doesn't affect our ability
to scan third-party dependencies.

Changes:
- Allow go-licenses report to fail (|| true)
- Filter out Fatal errors (^F) in addition to warnings/errors
- Validate we still got valid license data
- Exit with error only if no licenses found at all

This allows the action to continue and generate reports for third-party
dependencies while gracefully handling stdlib package errors.

* Fix license check action to filter Fatal errors consistently

- Add grep -v "^F" to all license-report-full.log processing
- Prevents Fatal error lines from corrupting counts and GitHub Actions outputs
- Fixes "Invalid format" error in GitHub Actions output
- Ensures consistent filtering across all grep commands

* Remove trailing blank line from NOTICE file

- Fix heredoc in generate-notice.sh to not add blank line before EOF
- Regenerate NOTICE file with correct single trailing newline
- Fixes pre-commit hook end-of-file-fixer check

* Improve license summary readability

- Replace shell variable assignments with human-readable text
- Change 'attribution_count=N' to 'Attribution-required dependencies: N'
- Change 'unknown_count=N' to 'Unknown-license dependencies: N'
- Keeps GitHub Actions outputs unchanged for automation

* Fix grep -c with || echo producing duplicate zeros

- Replace '|| echo "0"' with '|| true' for grep -c commands
- grep -c already outputs '0' when no matches found, but returns exit code 1
- The '|| echo "0"' was appending a second '0', creating "0\n0" in variables
- This caused GitHub Actions 'Invalid format' errors in outputs
- Affects ATTRIBUTION_COUNT and UNKNOWN_COUNT variables

* Replace custom license-check with GitHub dependency-review-action

## What Changed

- **Removed** custom .github/actions/license-check/ action (264 lines of brittle bash)
- **Removed** custom .github/workflows/license-check.yml workflow (44 lines)
- **Added** GitHub's native dependency-review-action workflow
- **Updated** scripts/README.md to document new approach

## Why This Is Better

**Reliability:**
- No more fighting with go-licenses stdlib errors (issue #128)
- No more grep -c edge cases with duplicate zeros
- No more GitHub Actions output format errors
- GitHub's license data from ClearlyDefined (industry standard)

**Simplicity:**
- 18 lines of workflow vs 308 lines of custom code
- Zero maintenance burden - GitHub maintains the action
- Works across all ecosystems, not just Go

**Functionality:**
- Still validates licenses on every PR
- Still blocks copyleft/restrictive licenses (GPL, LGPL, AGPL)
- Still checks for security vulnerabilities
- Automatically comments on PRs with details

## NOTICE File Generation

The NOTICE file remains in the repository and is updated manually using:
```bash
./scripts/generate-notice.sh
```

This is intentional to:
- Allow human review of license changes
- Keep file stable across builds
- Separate validation (automated) from documentation (manual)

## Migration Notes

License compliance is now enforced by GitHub's native dependency graph
rather than running go-licenses in CI. This is more reliable and requires
zero custom code to maintain.

* Add Go dependency submission for accurate license detection

## What Changed

Added `actions/go-dependency-submission@v2` action to submit Go dependencies
to GitHub's dependency graph before running dependency-review-action.

## Why

The dependency-review-action only detected workflow files (actions/checkout, etc)
and not the actual Go dependencies from go.mod because:

1. GitHub's dependency graph needs build-time detection for Go modules
2. The `go-dependency-submission` action resolves transitive dependencies
3. This provides accurate license detection for all 405 Go dependencies

## How It Works

1. **go-dependency-submission** job:
   - Analyzes go.mod and resolves all dependencies
   - Submits complete dependency tree to GitHub's dependency graph

2. **dependency-review** job:
   - Waits for dependency submission to complete
   - Reviews all Go dependencies for license compliance
   - Comments on PR if issues found

## References

- https://github.com/actions/go-dependency-submission
- https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/using-the-dependency-submission-api

* Simplify dependency-review workflow (remove failing go-dependency-submission)

## What Changed

Removed the `go-dependency-submission` job that was failing and returned
to the simple dependency-review-action workflow.

## Why This Is Correct

The dependency-review-action **already works with Go modules** by:
1. Detecting go.mod changes automatically via GitHub's dependency graph
2. Reviewing dependency **changes** between base and PR branches
3. Commenting on PRs when new/changed dependencies have license issues

## Why This PR Shows No Go Dependencies

This PR only changes:
- Workflow files (.github/workflows/)
- NOTICE file (documentation)
- Scripts (scripts/)

**It doesn't modify go.mod or go.sum**, so there are no Go dependency changes
to review. The action correctly scanned the workflow dependencies (actions/checkout,
actions/dependency-review-action) and found no issues.

## Testing the Go License Checking

To test Go license detection, a PR would need to:
1. Add/update a dependency in go.mod (e.g., `go get some/package`)
2. The action will detect the new dependency
3. If it has a denied license (GPL/LGPL/AGPL), the check will fail
4. A comment will be posted with details

## Recommendation

Keep this simple workflow. It correctly handles:
- ✅ Go module license compliance (on go.mod changes)
- ✅ Workflow dependency compliance (actions)
- ✅ Security vulnerability detection
- ✅ Zero maintenance burden

* Changes auto-committed by Conductor

* Add automated NOTICE file generation to workflows

- dependency-review.yml: Validate NOTICE is up-to-date on PRs
- autofix.yml: Auto-generate and commit NOTICE when dependencies change

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Run NOTICE generation on all PRs in autofix workflow

Previously only ran when go.mod/go.sum changed, but we want it to run
on all PRs to ensure NOTICE file stays up-to-date.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Upgrade autofix-ci/action to v1.3.2

Includes fixes for PR checkout issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add contents:read permission to autofix workflow

The autofix-ci action needs read access to upload artifacts and
interact with the GitHub API. Without this permission, artifact
uploads fail with JSON parsing errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add actions:write permission to autofix workflow

The autofix-ci action may need actions:write permission for artifact
uploads to work properly with GitHub's API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* Add runs-on/action@v2 for S3 cache compatibility

RunsOn requires the runs-on/action@v2 step when using extras=s3-cache
with actions/upload-artifact. Without this action, artifact uploads fail
with JSON parsing errors because the S3 cache backend is not properly
configured.

See: https://runs-on.com/features/s3-cache-for-github-actions/

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Claude <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Erik Osterman (Cloud Posse) (osterman) pushed a commit that referenced this pull request Nov 8, 2025
   1 fix: Upgrade containerd to v2.1.5 to address security vulnerabilities
   2
   3 This upgrade fixes two containerd security vulnerabilities:
   4
   5 - CVE-2024-25621 (High): Local privilege escalation via wide permissions on CRI directory
   6   - /var/lib/containerd created with 0o711 instead of 0o700
   7   - /run/containerd/io.containerd.grpc.v1.cri created with 0o755 instead of 0o700
   8   - /run/containerd/io.containerd.sandbox.controller.v1.shim created with 0o711 instead of 0o700
   9   - Allowed local users to access metadata/content stores and Kubernetes volumes
  10   - Fixed by automatically updating directory permissions on upgrade
  11
  12 - CVE-2025-64329 (Moderate): Host memory exhaustion through Attach goroutine leak
  13   - Repetitive CRI Attach calls (kubectl attach) could leak goroutines
  14   - Could exhaust host memory over time
  15   - Fixed by proper goroutine cleanup in CRI implementation
  16
  17 Upgraded github.com/containerd/containerd/v2 from v2.1.4 to v2.1.5
  18
  19 Resolves Dependabot alerts #128 and #129
  20
  21 🤖 Generated with [Claude Code](https://claude.com/claude-code)
  22
  23 Co-Authored-By: Claude <[email protected]>
Andriy Knysh (aknysh) pushed a commit that referenced this pull request Nov 8, 2025
…025-64329 (#1770)

* STDIN
   1 fix: Upgrade containerd to v2.1.5 to address security vulnerabilities
   2
   3 This upgrade fixes two containerd security vulnerabilities:
   4
   5 - CVE-2024-25621 (High): Local privilege escalation via wide permissions on CRI directory
   6   - /var/lib/containerd created with 0o711 instead of 0o700
   7   - /run/containerd/io.containerd.grpc.v1.cri created with 0o755 instead of 0o700
   8   - /run/containerd/io.containerd.sandbox.controller.v1.shim created with 0o711 instead of 0o700
   9   - Allowed local users to access metadata/content stores and Kubernetes volumes
  10   - Fixed by automatically updating directory permissions on upgrade
  11
  12 - CVE-2025-64329 (Moderate): Host memory exhaustion through Attach goroutine leak
  13   - Repetitive CRI Attach calls (kubectl attach) could leak goroutines
  14   - Could exhaust host memory over time
  15   - Fixed by proper goroutine cleanup in CRI implementation
  16
  17 Upgraded github.com/containerd/containerd/v2 from v2.1.4 to v2.1.5
  18
  19 Resolves Dependabot alerts #128 and #129
  20
  21 🤖 Generated with [Claude Code](https://claude.com/claude-code)
  22
  23 Co-Authored-By: Claude <[email protected]>

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Claude (via Conductor) <[email protected]>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants