Skip to content

Conversation

@adamancini
Copy link
Member

No description provided.

@chris-sanders chris-sanders marked this pull request as draft June 11, 2025 14:50
adamancini and others added 12 commits June 16, 2025 07:20
- replace inline customer creation with task customer-create
- replace inline cluster creation with task cluster-create
- use default k3s distribution instead of embedded-cluster
- increase cluster creation timeout to 15 minutes
- skip teardown of clusters and customers for faster subsequent runs
- removes unnecessary cleanup overhead for PR validation workflow
- change channel-create to use RELEASE_CHANNEL parameter
- pass RELEASE_CHANNEL as task parameter instead of env var
- ensure all task calls use correct variable names from taskfile
- channel-create: creates release channel if it doesn't exist
- channel-delete: archives release channel by name
- both tasks use RELEASE_CHANNEL parameter for consistency
Adds new helm-install-test job that performs end-to-end testing by:
- Logging into registry.replicated.com as a customer using email and license ID
- Running task helm-install with replicated helmfile environment
- Validating the complete customer deployment workflow

Depends on create-customer-and-cluster job and uses customer credentials for authentication.

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

Co-Authored-By: Claude <[email protected]>
Adds get-customer-license task to utils.yml that:
- Takes CUSTOMER_NAME parameter to lookup license ID
- Uses Replicated CLI to query customers by name
- Provides helpful error messages if customer not found
- Outputs license ID for use in other commands/workflows

Updates workflow to use the new task name for consistency.

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

Co-Authored-By: Claude <[email protected]>
Major performance and reliability improvements:

## Performance Optimizations
- Create composite action for tool setup to eliminate duplication across 4 jobs
- Add Helm dependency caching to reduce build times
- Enable parallelization by running lint-and-validate with build-release
- Consolidate environment variables at workflow level
- Flatten matrix strategy for better efficiency

## Reliability & Security
- Add retry logic for cluster creation (3 attempts, 30s delays)
- Implement proper job outputs for branch/channel names and license ID
- Add concurrency control to prevent interference between runs
- Pin all tool versions for reproducible builds
- Add prerequisites validation for required secrets
- Mask license ID in logs for security
- Upload debug artifacts on failure

## Timeout Optimizations
- Increase helm install timeout to 20 minutes for complex deployments
- Optimize cluster creation with retry-aware timeouts

Expected 30-40% performance improvement with enhanced reliability.
- Change fatal error to warning when WG_EASY_CUSTOMER_EMAIL secret is missing
- Add conditional execution for customer/cluster creation and helm install test
- Allows workflow to complete successfully for basic validation without customer secrets
- Enables testing of build, lint, and release steps in environments without full secrets
- Always create cluster for helm deployment testing
- Only skip customer registry login when WG_EASY_CUSTOMER_EMAIL secret missing
- Use default helmfile environment when customer secret unavailable
- Helm install step now validates deployment in all scenarios
- Provides test-license fallback for REPLICATED_LICENSE_ID
- Add helmfile v0.170.0 installation to composite action
- Include helmfile in tool caching for performance
- Enable helmfile installation in helm-install-test job
- Ensures helm-install task can execute helmfile sync commands
- Pinned version for reproducible builds
@adamancini adamancini force-pushed the adamancini/gh-actions branch from 0dda042 to 69ee34d Compare July 2, 2025 16:15
adamancini and others added 20 commits July 7, 2025 11:03
- Separate URL extraction into variable for better error handling
- Add validation to ensure download URL is found before attempting download
- Fix curl command that was failing with "no URL specified" error
- Improve error messages for debugging download issues

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

Co-Authored-By: Claude <[email protected]>
- Update tasks to use channel IDs alongside channel names for unique identification
- Add RELEASE_CHANNEL_ID parameter support to channel-create, channel-delete, customer-create
- Update GitHub Actions workflows to propagate channel IDs between jobs
- Enhance customer-helm-install to accept both CHANNEL_ID and CHANNEL_SLUG parameters
- Update task dependency graph with variable inputs/outputs and channel ID enhancements
- Fix markdownlint formatting issues in documentation

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

Co-Authored-By: Claude <[email protected]>
- Modify release-create task to accept RELEASE_CHANNEL_ID parameter
- Use channel ID for promotion when available, fall back to channel name
- Update GitHub Actions to pass channel ID from previous step
- Resolves "channel is ambiguous, please use channel ID" error

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

Co-Authored-By: Claude <[email protected]>
- Remove incorrect --channel-id flag usage
- Use --channel flag which accepts both channel names and IDs
- Simplify logic by passing channel ID directly to --channel parameter

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

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

- Add utility functions for channel ID/slug conversion (get-channel-slug, get-channel-id)
- Fix customer-helm-install to convert channel ID to channel slug before calling helmfile
- Fix customer-full-test-cycle channel ID lookup (.channelId → .id)
- Replace inline name normalization with centralized utils:normalize-name function
- Consolidate all name normalization logic for consistent git branch handling

This resolves OCI repository format errors where helmfile expected channel slugs
but was receiving channel IDs, causing invalid registry URLs like:
registry.replicated.com/app/CHANNEL_ID/chart vs registry.replicated.com/app/channel-slug/chart
… task

Add head -1 to ensure we get the first matching download URL when multiple
assets match the pattern. This fixes the GitHub Actions failure where the
CLI installation was failing with 'Could not find download URL' error.
Use hashFiles() to include utils.yml hash in cache key, ensuring that
changes to Replicated CLI installation logic trigger cache invalidation.
This prevents stale cached installations from persisting across commits.
- Create new wg-easy-pr-cleanup.yaml workflow that triggers only on PR close events
- Remove cleanup job from main PR validation workflow for cleaner separation
- Cleanup workflow handles resource cleanup (clusters, customers, channels) when PRs are closed
- Main validation workflow focuses only on validation, build, and testing
- Cleanup logs are uploaded with PR-specific artifact names for better tracking

This improves workflow efficiency by avoiding cleanup overhead during active development
and ensures resources are properly cleaned up when PRs are closed or merged.
… and correct channel slug handling

- Updated customer-helm-install to only require CUSTOMER_NAME and CLUSTER_NAME as inputs
- Added automatic license ID lookup using utils:get-customer-license
- Fixed channel ID to channel slug conversion to use .channelSlug instead of .name
- Channel slugs are now properly lowercase and normalized (e.g., "unstable" vs "Unstable")
- Improved helmfile.yaml.gotmpl to use license ID as username for registry authentication
- Made utils:get-customer-license silent and return only the license ID
- Added proper error handling and logging throughout the task
- Registry URLs now use correct channel slugs for proper authentication

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

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

- Updated Linux grep pattern from "linux_${ARCH}.tar.gz" to "*_linux_${ARCH}.tar.gz"
- Updated macOS to use "darwin_all.tar.gz" instead of "darwin_${ARCH}.tar.gz"
- Fixed error messages to reflect the correct patterns
- Resolves GitHub Actions PR validation failures due to CLI installation issues

The latest Replicated CLI releases use naming format:
- Linux: replicated_0.107.0_linux_amd64.tar.gz
- macOS: replicated_0.107.0_darwin_all.tar.gz

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

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

- Changed WG_EASY_REPLICATED_APP from secrets to vars in wg-easy-pr-validation.yaml
- Changed WG_EASY_REPLICATED_APP from secrets to vars in wg-easy-pr-cleanup.yaml
- Repository variables are used for non-sensitive configuration values
- Secrets remain for sensitive values like API tokens

Updated workflows:
- wg-easy-pr-validation.yaml: env.REPLICATED_APP now uses vars.WG_EASY_REPLICATED_APP
- wg-easy-pr-cleanup.yaml: env.REPLICATED_APP now uses vars.WG_EASY_REPLICATED_APP

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

Co-Authored-By: Claude <[email protected]>
- Changed 'replicated channel archive' to 'replicated channel rm'
- The current Replicated CLI version 0.107.0 uses 'rm' instead of 'archive'
- This fixes the PR cleanup workflow which was showing help instead of deleting channels
- The rm command properly archives channels as intended

Verified with: replicated channel rm --help shows correct usage
Error was: replicated channel archive command not found, showing help instead

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

Co-Authored-By: Claude <[email protected]>
- Add chartVersions configuration to both default and replicated environments
- Use yq exec to read version from each chart's Chart.yaml file dynamically
- Update all release definitions to use dynamic versions instead of hardcoded values
- Remove hardcoded versions: 1.0.0 for most charts, 1.7.0 for replicated-sdk
- Ensure version consistency between Chart.yaml files and helmfile deployments
- Include example files showing both inline and centralized approaches

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

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

This comment was marked as outdated.

@adamancini adamancini merged commit fd3132f into main Jul 14, 2025
9 checks passed
@adamancini adamancini deleted the adamancini/gh-actions branch July 14, 2025 15:04
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.

4 participants