Skip to content

Conversation

@twoGiants
Copy link
Contributor

Changes

  • 🎁 Add --use-registry-login flag to enable/disable registry login step in generated workflow (default: true)
  • 🎁 Add --self-hosted-runner flag to use self-hosted runners instead of ubuntu-latest (default: false)
  • 🎁 Add --registry-login-url-variable-name flag to customize the registry URL variable name in the workflow (default: REGISTRY_LOGIN_URL)
  • 🎁 Add --registry-user-variable-name flag to customize the registry username variable name in the workflow (default: REGISTRY_USERNAME)
  • 🎁 Add --registry-pass-secret-name flag to customize the registry password secret name in the workflow (default: REGISTRY_PASSWORD)
  • 🎁 Add registry login step using docker/login-action@v3 in generated workflows
  • 🧹 Refactor workflow generation into separate helper functions for better maintainability
  • 🧹 Update registry URL construction to use login URL + username when registry login is enabled

/kind enhancement

Relates to #3256

Release Note

The `func config ci` command now supports configurable registry authentication and runner options with the following new flags:
- `--use-registry-login`: Enable/disable registry login step in generated workflow (default: true)
- `--registry-login-url-variable-name`: Customize registry URL variable name (default: REGISTRY_LOGIN_URL)
- `--registry-user-variable-name`: Customize registry username variable name (default: REGISTRY_USERNAME)
- `--registry-pass-secret-name`: Customize registry password secret name (default: REGISTRY_PASSWORD)
- `--self-hosted-runner`: Use self-hosted runners instead of ubuntu-latest (default: false)

Docs


GitHub workflows generated by 'func config ci' previously lacked
registry authentication. Now a registry login step was added.

Add new flags for registry authentication and runner configuration:
- --use-registry-login: enable/disable registry login step
  (default: true)
- --registry-login-url-variable-name: customize registry URL
  variable (default: REGISTRY_LOGIN_URL)
- --registry-user-variable-name: customize username variable
  (default: REGISTRY_USERNAME)
- --registry-pass-secret-name: customize password secret
  (default: REGISTRY_PASSWORD)
- --self-hosted-runner: use self-hosted instead of ubuntu-latest
  runners (default: false)

Workflow generation logic is refactored into helper functions
for better maintainability. More logic will be added to this
functions in follow up PRs.

Issue knative#3256

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
@knative-prow knative-prow bot added kind/enhancement size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 15, 2025
@knative-prow knative-prow bot requested a review from dsimansk December 15, 2025 17:17
@twoGiants
Copy link
Contributor Author

/cc @lkingland @matejvasek @gauron99

@codecov
Copy link

codecov bot commented Dec 15, 2025

Codecov Report

❌ Patch coverage is 81.73077% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.98%. Comparing base (4ef5654) to head (8281346).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/ci/workflow.go 75.47% 11 Missing and 2 partials ⚠️
cmd/ci/config.go 62.50% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3297      +/-   ##
==========================================
+ Coverage   54.92%   54.98%   +0.06%     
==========================================
  Files         170      170              
  Lines       19744    19824      +80     
==========================================
+ Hits        10844    10900      +56     
- Misses       7832     7852      +20     
- Partials     1068     1072       +4     
Flag Coverage Δ
e2e 39.67% <0.00%> (-0.21%) ⬇️
e2e go 35.69% <0.00%> (-0.19%) ⬇️
e2e node 31.13% <0.00%> (-0.23%) ⬇️
e2e python 35.34% <0.00%> (-0.18%) ⬇️
e2e quarkus 31.34% <0.00%> (-0.16%) ⬇️
e2e rust 30.80% <0.00%> (-0.13%) ⬇️
e2e springboot 30.83% <0.00%> (-0.14%) ⬇️
e2e typescript 31.31% <0.00%> (-0.16%) ⬇️
integration 17.49% <0.00%> (-0.10%) ⬇️
unit macos-14 44.88% <82.41%> (+0.15%) ⬆️
unit macos-latest 44.88% <82.41%> (+0.15%) ⬆️
unit ubuntu-24.04-arm 45.01% <81.73%> (+0.12%) ⬆️
unit ubuntu-latest 45.78% <82.41%> (+0.14%) ⬆️
unit windows-latest 44.90% <82.41%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@gauron99 gauron99 left a comment

Choose a reason for hiding this comment

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

/lgtm
just left some non-blocking comments. Thanks!

Comment on lines +41 to +45
steps = createCheckoutStep(steps)
steps = createK8ContextStep(conf, steps)
steps = createRegistryLoginStep(conf, steps)
steps = createFuncCLIInstallStep(steps)
steps = createFuncDeployStep(conf, steps)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like these one line steps, much cleaner :)

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2025
@knative-prow
Copy link

knative-prow bot commented Dec 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gauron99, twoGiants

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2025
@knative-prow knative-prow bot merged commit 0840be5 into knative:main Dec 17, 2025
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/enhancement lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants