Skip to content

Conversation

@twoGiants
Copy link
Contributor

Changes

  • 🎁 tba ...
  • 🧹 tba ...

/kind enhancement

Fixes #tba...

Release Note


Docs


@knative-prow
Copy link

knative-prow bot commented Oct 22, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement labels Oct 22, 2025
@knative-prow knative-prow bot requested review from jrangelramos and nainaz October 22, 2025 12:26
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 22, 2025
@knative-prow knative-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 22, 2025
@twoGiants twoGiants force-pushed the issue-744-generate-github-actions-workflow branch 2 times, most recently from edad0e7 to 2b2cc43 Compare October 24, 2025 16:48
@knative-prow knative-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 24, 2025
@twoGiants twoGiants force-pushed the issue-744-generate-github-actions-workflow branch from 48ac762 to c2000cd Compare November 7, 2025 12:16
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2025
@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 73.85621% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.00%. Comparing base (8f447a8) to head (4dd59ad).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
cmd/ci/workflow.go 81.25% 6 Missing and 6 partials ⚠️
cmd/testing/factory.go 0.00% 12 Missing ⚠️
cmd/ci/config.go 60.00% 10 Missing ⚠️
cmd/config.go 50.00% 3 Missing ⚠️
cmd/config_ci.go 92.59% 1 Missing and 1 partial ⚠️
cmd/config_volumes.go 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3128      +/-   ##
==========================================
+ Coverage   62.85%   64.00%   +1.14%     
==========================================
  Files         148      155       +7     
  Lines       13202    13339     +137     
==========================================
+ Hits         8298     8537     +239     
+ Misses       3941     3809     -132     
- Partials      963      993      +30     
Flag Coverage Δ
e2e-tests 42.80% <31.20%> (+1.32%) ⬆️
integration-tests 58.42% <62.74%> (+1.84%) ⬆️
unit-tests 50.36% <62.74%> (?)

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.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 12, 2025
@knative-prow
Copy link

knative-prow bot commented Nov 25, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: twoGiants
Once this PR has been reviewed and has the lgtm label, please assign matejvasek for approval. For more information see the Code Review Process.

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

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

@twoGiants twoGiants force-pushed the issue-744-generate-github-actions-workflow branch 4 times, most recently from 82faa71 to 6d6a8bd Compare December 2, 2025 08:29
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 2, 2025
@twoGiants twoGiants force-pushed the issue-744-generate-github-actions-workflow branch from 6d6a8bd to cd38ebc Compare December 3, 2025 17:01
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2025
@knative-prow-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Add comprehensive memory files documenting deployment to local
kind clusters and remote OpenShift environments, covering auth
flows, registry config, Tekton setup, and GitHub Actions.

- Add TDD and implementation guidelines to CLAUDE.md
- Create /creview slash command for code reviews
- Create issue-744 feature doc

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Add 'func config ci' command as foundation for GitHub Actions
workflow generation.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Add functionality to create GitHub Actions workflow directory and file
when running config ci command. Includes CIConfig struct for managing
workflow paths and permissions, with comprehensive test coverage.

Also fixes typo and refactors config tests to use helper functions.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
- Add YAML structure types for workflow generation
- Generate hard coded remote-build-and-deploy workflow with checkout,
  func cli setup, and deploy steps
- Validate workflow structure and content in tests
- Export NewCIConfig for external use

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
- Move CIConfig and workflow structs to cmd/ci package
- Separate config management (config.go) and workflow generation
  (workflow.go)
- Add CIConfig methods for path resolution
- Support custom workflow names via NewDefaultCIConfigWithName
- Update imports across cmd package

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
- Add NewGithubWorkflowFromPath for loading workflows from disk
- Replace AsYaml + PersistToDisk with Persist method that handles both
  marshalling and file operations
- Rename FnGithubWorkflowYamlPath to FnGithubWorkflowFilepath
- Extract test assertion logic into helper functions
- Improve test readability with consistent naming and structure

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
- Add Kubernetes context setup using azure/k8s-set-context action with
  configurable kubeconfig secret key
- Add optional container registry authentication with conditional execution
- Support self-hosted runners configuration
- Number workflow steps for better readability

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Enable optional registry authentication in CI workflows to support
both secure and insecure registry scenarios. Add configuration for
custom registry secret keys.

Introduce CIConfigBuilder for flexible configuration in tests.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Adds support for local, remote workflow generation and debug
configuration via command-line flags.

Workflow name and registry login can be configured via flags
too. Debug mode adds workflow_dispatch trigger and func CLI
caching for rapid iterations on workflow runs.

Config creation refactored to use cobra flags.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Replaces pre-built CIConfig objects with command-line flags for
more flexible configuration and realistic testing.

- Add --remote, --debug, --self-hosted-runner flags
- Update tests to use flag parsing
- Set workflow name based on --remote flag

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Rename configuration fields to separate GitHub secrets (sensitive)
from variables (non-sensitive):

- Registry URL/user changed from secrets to variables
- Add separate registryUrlVar for `func deploy --registry=URL`
- Renamed selfHostedRunner to useSelfHostedRunner for consistency

Update workflow generation to use ${{ vars.* }} for variables and
${{ secrets.* }} for secrets.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Add command-line flags for CI configuration. This makes all
configuration explicit and user-controllable at the command level.

- Replace NewGithubWorkflow's 10 parameters with single CIConfig
- Extract hardcoded defaults to named constants
- Add branch configuration option
- Remove temporary ciConfig parameter from command constructors

The NewCiGithubConfigVia function now reads all configuration
directly from command flags, eliminating the need to construct
and pass config objects through the call chain.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Add FUNC_ENABLE_CI_CONFIG environment variable that must be set
to 'true' to use the 'func config ci' command. This allows
controlled enablement of the CI configuration feature during
development and testing.

Test improvements:
- Add feature flag requirement test
- Add --path flag support for custom function locations
- Remove --github flag (only one CI provider currently)
- Refactor test helpers (defaultOpts, assertion functions)
- Update all tests to explicitly enable feature flag

Use viper for CI configuration. Previous implementation used a
builder pattern and extracted configuration from cobra.Command
flags, because of viper flag propagation issues. This prevented
flags like --use-registry-login and --workflow-name from working
correctly in tests and actual use.

Configuration is now read directly from viper. The builder
pattern was removed, it had no use anymore.

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
Introduced WorkflowWriter interface to decouple workflow generation
from filesystem operations. Previously, githubWorkflow.Persist()
directly wrote files, making unit tests require filesystem I/O.
Now, Export() accepts a WorkflowWriter, enabling tests to verify
YAML generation in-memory using BufferWriter while production code
uses fileWriter for actual file operations.

Moved feature flag check from runtime to command registration,
preventing the subcommand from appearing when feature is disabled
rather than failing during execution.

Reorganized tests into unit tests (mocked I/O) and integration
tests (real filesystem).

Additional changes:
- Made workflow types private (githubWorkflow, job, step, etc)
- Renamed *Option constants to *Flag for consistency
- Corrected GitHub capitalization throughout codebase
- Added MockLoaderSaver to common package for test reuse

Issue SRVOCF-744

Signed-off-by: Stanislav Jakuschevskij <sjakusch@redhat.com>
@twoGiants twoGiants force-pushed the issue-744-generate-github-actions-workflow branch from 491478e to f717c21 Compare December 12, 2025 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants