GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: Remote git builds need no local checkout and build the commit they read by gauron99 · Pull Request #4039 · knative/func Conversation
|
|
Skipping CI for Draft Pull Request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gauron99 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remote metadata, built source, and persisted deployment identity can diverge in several supported flows.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Enables remote git deployments without a local function checkout and includes the CoreDNS rollout prerequisite.
Changes:
func.yaml directly from git.| File | Description |
|---|---|
pkg/pipelines/tekton/templates.go |
Supports rootless functions and commit labels. |
pkg/pipelines/tekton/templates_test.go |
Tests rootless pipeline rendering. |
pkg/pipelines/tekton/tasks_test.go |
Verifies cleanup-step ordering. |
pkg/pipelines/tekton/task-s2i.yaml.tmpl |
Cleans git source workspace. |
pkg/pipelines/tekton/task-buildpack.yaml.tmpl |
Cleans git source workspace. |
pkg/pipelines/tekton/source_commit_test.go |
Tests source commit resolution. |
pkg/pipelines/tekton/pipelines_provider.go |
Resolves commits before resource creation. |
pkg/functions/git_commit.go |
Adds remote commit lookup. |
pkg/functions/function.go |
Parses rootless serialized functions. |
pkg/functions/function_migrations.go |
Migrates directly from serialized bytes. |
pkg/functions/function_git.go |
Loads functions from git revisions. |
pkg/functions/function_git_test.go |
Tests git loading and migration. |
pkg/functions/client.go |
Reuses serialized-function parsing. |
pkg/cluster/dns.go |
Waits for the CoreDNS rollout. |
e2e/e2e_remote_test.go |
Removes local checkout workarounds. |
docs/reference/func_deploy.md |
Documents checkout-free deployment. |
cmd/run.go |
Supplies function context to prompts. |
cmd/deploy.go |
Selects and persists remote functions. |
cmd/deploy_test.go |
Tests checkout-free deploy behavior. |
cmd/config_git_set.go |
Supplies function context to prompts. |
cmd/build.go |
Supplies function context to prompts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
a2d8a9a to
4ebfbf9
Compare
4ebfbf9 to
0640992
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Remote configuration precedence, prompt source switching, and local state persistence can deploy or record the wrong function state.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
describe or delete when the local and repository functions…Stamp() below,…GitURL in Prompt, but this reload is skipped when…
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
0640992 to
acbe413
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Interactive choices can be overwritten, and rootless source revision handling can panic or apply an unrelated local commit label.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
acbe413 to
a14955f
Compare
…d at The image's revision label came from the local checkout's HEAD for every remote build. For a function read from its repository that is the wrong commit, or none. Source gains an in-memory Commit, the hash the revision resolved to when the function was read; when set, the PipelineRun fetches that commit and labels the image with it, so what was read is what is built. Uploaded sources keep the local HEAD. The PipelineRun no longer turns an empty revision into a hard-coded "main": the revision goes to the fetch step as configured, and an empty one fetches the remote's default branch, whatever its name.
NewFunctionFromGit reads func.yaml from a revision of a remote repository (default branch, branch, tag or commit hash) in memory, and records the commit that revision resolved to in Build.Source.Commit, for the build to fetch and label. It reuses the credential lookup the template repositories already use. Migrations used to re-read the on-disk func.yaml from f.Root to see the previous structure, so a function with no working tree could not be migrated. hasInitializedFunction in the client hit the same problem by migrating an unmarshalled function that had no Root. Migrations now receive the serialized bytes they were parsed from, and NewFunction, NewFunctionFromGit and hasInitializedFunction share parseFunction. The build prompt takes the function instead of reading it from a path, so it works for a function that is not on disk. It no longer asks for the project path: every other default it offers already came from the function at the original path, and a changed answer was reloaded by build and run but silently ignored by deploy and config git set. The path is given with --path, as before, and each command reads the function once. Groundwork for knative#3203.
The git-clone StepAction runs as user 65532 and empties the source workspace before cloning. The previous run of the pipeline leaves the sources there owned by the build user (the prepare step chowns the tree to 1001 for the buildpacks lifecycle), which 65532 can neither delete nor create .git next to. Every remote build of a function from git after its first therefore failed in the fetch step, until func delete removed the volume. A clean-src step, run as root and gated on a git URL like fetch-src, now empties the workspace and hands the directory to the clone user before the clone. The upload path is unaffected, and the cache workspace is a separate directory that is left alone.
The flag defaults of deploy are derived from the function in the current directory when the command is built, so a local func.yaml is honoured unless a flag or environment variable overrides it. A function read from a git repository is known only at run time and got no such treatment: from an empty directory the static defaults applied, and Configure then overwrote, for example, the repository's s2i builder with pack. withFunctionDefaults gives the config the defaults NewDeployCmd would have registered had the repository's function been the local one, for every flag the user did not set. The reload after the prompt now also happens when the prompt changed the git source of a function that already came from git, not only when it made a local function remote.
A remote deployment of a git repository recorded the git settings and the outcome (image, namespace, deployer, exposure) on whatever local function was at the path, a habit from when the local func.yaml was the source of such a deployment. It was wrong for a checkout on another branch, misleading for a different function, and it stamped sources that were never built. Such a deployment is now a deployment by reference: the function is read from the repository, deployed, and nothing is written, neither to the repository nor to the current directory. To change a function that lives in a repository, clone it, edit it and deploy the working tree. A func.yaml may still carry build.source settings, which serve as the defaults of the --source flags. Loading is one function, loadFunction, without a local function to consult.
a14955f to
535e5cf
Compare
|
PR needs rebase. DetailsInstructions 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. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
this PR is broken down into smaller items of which first one is #4064, closing that in favor of 4064 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.