Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deploy command global config with function context #1434

Merged
merged 18 commits into from
Feb 6, 2023

Conversation

lkingland
Copy link
Member

@lkingland lkingland commented Nov 16, 2022

  • 🎁 global config function context for the deploy command
  • 🎁 Enables build caching for deploy in more scenarios
  • 🎁 Adds tests for ENVs and attribute unsetting
  • 🧹 a wee bit of refactoring along the way

Related: #901

/kind enhancement

Release Note

Current function values more accurately reflected in 'deploy' command help text.
Builds cache more frequently when running func deploy

@lkingland lkingland added this to the 1.9.0 Release milestone Nov 16, 2022
@knative-prow knative-prow bot added kind/enhancement do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 16, 2022
@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 16, 2022
@knative-prow knative-prow bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 16, 2022
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from 37fbe81 to 43b1167 Compare November 22, 2022 13:48
@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 22, 2022
@lkingland lkingland changed the title [WIP] feat: function context for deploy command feat: function context for deploy command Nov 22, 2022
@lkingland lkingland changed the title feat: function context for deploy command feat: deploy command global config with function context Nov 22, 2022
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 54.40% // Head: 63.70% // Increases project coverage by +9.30% 🎉

Coverage data is based on head (bb88a95) compared to base (10c9948).
Patch coverage: 74.08% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1434      +/-   ##
==========================================
+ Coverage   54.40%   63.70%   +9.30%     
==========================================
  Files          72       75       +3     
  Lines       10685    10826     +141     
==========================================
+ Hits         5813     6897    +1084     
+ Misses       4441     3359    -1082     
- Partials      431      570     +139     
Flag Coverage Δ
integration-tests 54.62% <71.16%> (?)
unit-tests ?
unit-tests-macos-latest 53.21% <74.08%> (?)
unit-tests-ubuntu-latest 54.63% <74.08%> (?)
unit-tests-windows-latest 53.25% <74.08%> (?)

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

Impacted Files Coverage Δ
client.go 59.84% <54.28%> (+1.82%) ⬆️
cmd/build.go 72.10% <66.66%> (+0.48%) ⬆️
cmd/root.go 76.51% <70.00%> (-1.49%) ⬇️
cmd/deploy.go 68.45% <75.87%> (+4.79%) ⬆️
cmd/list.go 69.72% <100.00%> (+4.67%) ⬆️
cmd/run.go 72.35% <100.00%> (ø)
config/config.go 87.73% <100.00%> (-0.12%) ⬇️
function.go 83.33% <100.00%> (ø)
openshift/metadata.go 0.00% <0.00%> (ø)
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from 25e9620 to c670d14 Compare December 12, 2022 02:19
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from c670d14 to 4b6b36c Compare January 16, 2023 06:25
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2023
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from 317aea9 to a73b6ab Compare January 17, 2023 12:00
@knative-prow-robot knative-prow-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 17, 2023
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from 0ee7e09 to 3f5f6cb Compare January 20, 2023 08:54
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 20, 2023
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from 3f5f6cb to 56c3a33 Compare January 20, 2023 09:33
@lance
Copy link
Member

lance commented Jan 24, 2023

Probably fixes: #1492

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 25, 2023
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from a686b3d to 47260a8 Compare January 25, 2023 03:44
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 25, 2023
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch 6 times, most recently from 41adee6 to c5f2d46 Compare January 26, 2023 09:45
@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2023
@salaboy
Copy link
Member

salaboy commented Feb 4, 2023

@lkingland it seems that this needs rebase, but it is looking good

- Built() now a client package function
- Namespace evaluation delegeate to implementations
  This enables the func.yaml to avert dirtiness checks on rebuilds
  (caching)
- Build and Deploy update build stamp on completion
  Enables dirtiness checks to be unaffects, leading to better caching.
- CLI Namespace checks no longer require k8s env evaluation for default
- Fixed missing condition check in TestDeploy_Namespace
- Fixes some minor linter and spelling errors
- Global config does not directly set namespace - it is corrected to be
  deferred evaluation used by implementations.
- Skips writing func.yaml on f.Write if there were no modifications,
  which leads to better caching (no timestamp update means Built ==
  true)
- HasImage removed in favor of a corrected fn.Built
@lkingland lkingland force-pushed the lkingland/deploy-global-config branch from dc7e0f7 to bb88a95 Compare February 5, 2023 22:11
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 5, 2023
@salaboy
Copy link
Member

salaboy commented Feb 6, 2023

/lgtm

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 6, 2023
Copy link
Member

@salaboy salaboy left a comment

Choose a reason for hiding this comment

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

/lgtm

@knative-prow
Copy link

knative-prow bot commented Feb 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lkingland, salaboy

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

The pull request process is described 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

@knative-prow knative-prow bot merged commit 958429c into knative:main Feb 6, 2023
lance pushed a commit to lance/func that referenced this pull request Feb 15, 2023
* feat: deploy command global config function context

* fix static check errors

* fix test

* fix remote persists test

* env opaque box test

* use keyed fields (govet)

* mock deployer expansion

* ClearEnvs now in shared testing pkg

* effectivePath now uses plfags

* list directly uses config for default namespace

* Improved Namespace calculation and Caching

- Built() now a client package function
- Namespace evaluation delegeate to implementations
  This enables the func.yaml to avert dirtiness checks on rebuilds
  (caching)
- Build and Deploy update build stamp on completion
  Enables dirtiness checks to be unaffects, leading to better caching.
- CLI Namespace checks no longer require k8s env evaluation for default
- Fixed missing condition check in TestDeploy_Namespace
- Fixes some minor linter and spelling errors
- Global config does not directly set namespace - it is corrected to be
  deferred evaluation used by implementations.
- Skips writing func.yaml on f.Write if there were no modifications,
  which leads to better caching (no timestamp update means Built ==
  true)
- HasImage removed in favor of a corrected fn.Built

* linting, misspellings and docs rebuild

* warn user if git settings exist on a non-remote build

* lint error fix

* test flag unsetting persists

* allow unknown flags in preparsing of flags

* pre-submit cleanup

* update cmd to use client.Init
@lkingland lkingland deleted the lkingland/deploy-global-config branch March 6, 2023 03:21
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants