Skip to content

Comments

Improve distribution of helm chart#835

Open
filippomc wants to merge 15 commits intodevelopfrom
feature/CH-239
Open

Improve distribution of helm chart#835
filippomc wants to merge 15 commits intodevelopfrom
feature/CH-239

Conversation

@filippomc
Copy link
Collaborator

@filippomc filippomc commented Feb 20, 2026

Closes CH-239

Implemented solution

Generation scripts and templates have been changed to include the new parameters and configuration

  • Added harness.image_name field to allow applications to use custom Docker image names instead of directory-based names
  • Added CLI arguments (--name, --chart-version, --app-version) to customize Helm chart metadata during deployment
  • Added publish skip conditions for Codefresh CI/CD to enable selective image publishing

How to test this PR

Check the test deployment:

  1. the samples image should be named "sample" now, thanks to the new image_name parameter
  2. New parameters are available on Codefresh

Sanity checks:

  • The pull request is explicitly linked to the relevant issue(s)
  • The issue is well described: clearly states the problem and the general proposed solution(s)
  • In this PR it is explicitly stated how to test the current change
  • The labels in the issue set the scope and the type of issue (bug, feature, etc.)
  • The relevant components are indicated in the issue (if any)
  • All the automated test checks are passing
  • All the linked issues are included in one Sprint
  • All the linked issues are in the Review state
  • All the linked issues are assigned

Breaking changes (select one):

  • The present changes do not change the preexisting api in any way
  • This PR and the issue are tagged as a breaking-change and the migration procedure is well described above

Possible deployment updates issues (select one):

  • There is no reason why deployments based on CloudHarness may break after the current update
  • This PR and the issue are tagged as alert:deployment

Test coverage (select one):

  • Tests for the relevant cases are included in this pr
  • The changes included in this pr are out of the current test coverage scope

Documentation (select one):

  • The documentation has been updated to match the current changes
  • The changes included in this PR are out of the current documentation scope

filippomc and others added 8 commits January 8, 2025 10:44
- Updated deployment configurations to include optional helm metadata arguments such as chart name, chart version, and app version in `codefresh-template-stage.yaml` and `codefresh-template-test.yaml`.
- Refactored helm chart creation logic to support these new parameters in `helm.py`.
- Added new field `image_name` in ApplicationHarnessConfig to allow custom image naming.
- Updated OpenAPI and model documentation to reflect the new `image_name` field.
- Added tests to validate the inclusion of helm metadata arguments and image name overrides in deployment configurations.
- Cleaned up unused build steps in `codefresh-test.yaml` and removed redundant commands.
commands:
- bash cloud-harness/install.sh
- harness-deployment $PATHS -d ${{DOMAIN}} -r ${{REGISTRY}} -rs '${{REGISTRY_SECRET}}' -n ${{NAMESPACE}} --write-env -e $ENV --cache-url '${{IMAGE_CACHE_URL}}' $PARAMS
- export HELM_META_ARGS="$( [ -n "${{HARNESS_CHART_NAME}}" ] && printf -- "--name %s " "${{HARNESS_CHART_NAME}}"; [ -n "${{HARNESS_CHART_VERSION}}" ] && printf -- "--chart-version %s " "${{HARNESS_CHART_VERSION}}"; [ -n "${{HARNESS_APP_VERSION}}" ] && printf -- "--app-version %s" "${{HARNESS_APP_VERSION}}" )"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves the distribution of Helm charts by adding customization options for image names and chart metadata. The changes support custom image names for applications, allow overriding Helm chart metadata (name, version, appVersion), and add conditional publishing controls for CI/CD pipelines.

Changes:

  • Added harness.image_name field to allow applications to use custom Docker image names instead of directory-based names
  • Added CLI arguments (--name, --chart-version, --app-version) to customize Helm chart metadata during deployment
  • Added publish skip conditions for Codefresh CI/CD to enable selective image publishing
  • Added upgrade documentation for migrating from CloudHarness 2.x to 3.x
  • Added GitHub Copilot instruction files for better AI assistant integration
  • Version change in models library from 3.0.0 to 1.0.0

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
tools/deployment-cli-tools/ch_cli_tools/helm.py Implements custom image name support and chart metadata merging logic
tools/deployment-cli-tools/ch_cli_tools/codefresh.py Adds publish skip condition logic for controlling image publishing
tools/deployment-cli-tools/ch_cli_tools/utils.py Adds null check to get_image_name function
tools/deployment-cli-tools/harness-deployment Adds CLI arguments for chart metadata customization
tools/deployment-cli-tools/tests/test_helm.py Adds tests for image name override and chart metadata features
tools/deployment-cli-tools/tests/test_codefresh.py Adds tests for publish skip conditions and helm metadata args
tools/deployment-cli-tools/tests/test_skaffold.py Updates tests to use dynamic image names from values
tools/deployment-cli-tools/tests/resources/applications/myapp/deploy/values-imagename.yaml Test fixture for custom image name feature
libraries/models/pyproject.toml Changes version from 3.0.0 to 1.0.0 (potential issue)
libraries/models/cloudharness_model/models/application_harness_config.py Adds image_name field to ApplicationHarnessConfig model
libraries/models/api/openapi.yaml Adds image_name field to API schema
libraries/models/docs/ApplicationHarnessConfig.md Documents the new image_name field
docs/model/ApplicationHarnessConfig.md Documents the new image_name field
docs/upgrades/2.x_3.x.md New upgrade documentation for migrating from 2.x to 3.x
deployment-configuration/codefresh-template-*.yaml Adds HELM_META_ARGS environment variable construction
deployment/codefresh-test.yaml Generated file with updated build order and helm metadata args
applications/samples/deploy/values.yaml Example usage of custom image_name and cloudharness-base dependency
.github/instructions/*.md New GitHub Copilot instruction files for project guidance
openapitools.json Deleted OpenAPI generator configuration
ch-166.patch Deleted patch file
deployment-configuration/codefresh-template-stage-onpremise.yaml Deleted on-premise deployment template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant