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(lua actions): add a flag to Include builtin actions with resource overrides #19708

Merged
merged 8 commits into from
Sep 10, 2024

Conversation

ashutosh16
Copy link
Contributor

@ashutosh16 ashutosh16 commented Aug 28, 2024

fixes #19707

To test:
add the below config to the configmap

data:
 resource.customizations.actions.argoproj.io_Rollout: |
 mergeBuiltinActions: true
  discovery.lua: |
    actions = {}
    actions["test-action"] = {}
    return actions
  definitions:
  - name: test-action
    action.lua: |
      return obj

Verified the following:

  • existing behaviour with overrides and prebuilt actions
  • with mergeBuiltinActions set to true. action contains upstream action and override actions
Screen.Recording.2024-09-03.at.14.25.41.mov

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

Copy link

bunnyshell bot commented Aug 28, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

bunnyshell bot commented Aug 28, 2024

❌ Preview Environment deleted from Bunnyshell

Available commands (reply to this comment):

  • 🚀 /bns:deploy to deploy the environment

Copy link

codecov bot commented Aug 28, 2024

Codecov Report

Attention: Patch coverage is 72.91667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 55.83%. Comparing base (878494f) to head (b43d05b).
Report is 448 commits behind head on master.

Files with missing lines Patch % Lines
util/lua/lua.go 73.33% 7 Missing and 5 partials ⚠️
server/application/application.go 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #19708      +/-   ##
==========================================
- Coverage   55.84%   55.83%   -0.01%     
==========================================
  Files         320      320              
  Lines       44316    44329      +13     
==========================================
+ Hits        24747    24751       +4     
- Misses      17012    17019       +7     
- Partials     2557     2559       +2     

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

@ashutosh16 ashutosh16 changed the title add a flag to Include builtin actions with resource overrides feat: add a flag to Include builtin actions with resource overrides Aug 28, 2024
@ashutosh16 ashutosh16 changed the title feat: add a flag to Include builtin actions with resource overrides feat(lua actions): add a flag to Include builtin actions with resource overrides Aug 28, 2024
@ashutosh16 ashutosh16 force-pushed the include-builtin branch 2 times, most recently from 0428eeb to fb7525f Compare August 28, 2024 17:16
@ashutosh16 ashutosh16 marked this pull request as ready for review August 28, 2024 17:19
@ashutosh16 ashutosh16 requested a review from a team as a code owner August 28, 2024 17:19
pkg/apis/application/v1alpha1/types.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
leoluz
leoluz previously requested changes Aug 30, 2024
Copy link
Collaborator

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Please check my comments

pkg/apis/application/v1alpha1/types.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
@ashutosh16 ashutosh16 requested a review from a team as a code owner September 3, 2024 17:46
@ashutosh16 ashutosh16 enabled auto-merge (squash) September 3, 2024 23:10
@agaudreault
Copy link
Member

FYI, take a look at #16905 (comment).

The merge might be conflicting or result in an undefined behavior if glob are used.

@ashutosh16
Copy link
Contributor Author

FYI, take a look at #16905 (comment).

The merge might be conflicting or result in an undefined behavior if glob are used.

I don't see the glob is used to determine resource action.

util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
docs/operator-manual/resource_actions.md Outdated Show resolved Hide resolved
docs/operator-manual/resource_actions.md Outdated Show resolved Hide resolved
@ashutosh16 ashutosh16 force-pushed the include-builtin branch 4 times, most recently from b704567 to 2a8a6eb Compare September 5, 2024 18:33
@ashutosh16 ashutosh16 disabled auto-merge September 5, 2024 22:58
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua.go Outdated Show resolved Hide resolved
util/lua/lua_test.go Outdated Show resolved Hide resolved
@ashutosh16 ashutosh16 force-pushed the include-builtin branch 2 times, most recently from 6d6973b to a07dee6 Compare September 10, 2024 06:39
Copy link
Member

@agaudreault agaudreault left a comment

Choose a reason for hiding this comment

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

LGTM

@ashutosh16 ashutosh16 enabled auto-merge (squash) September 10, 2024 15:53
ashutosh16 and others added 8 commits September 10, 2024 08:53
Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>
Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>

Update util/lua/lua.go

Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>
Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>

feat: analysis modal

Signed-off-by: ashutosh16 <[email protected]>

feat: include prebuilt action with overrides

Signed-off-by: ashutosh16 <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>

Update util/lua/lua.go

Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>

Update util/lua/lua.go

Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>

Update util/lua/lua.go

Co-authored-by: Alexandre Gaudreault <[email protected]>
Signed-off-by: Ashu <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>

feat: add flag MergeBuiltinActions to include all actions

Signed-off-by: ashutosh16 <[email protected]>
@ashutosh16 ashutosh16 merged commit 5776554 into master Sep 10, 2024
29 of 30 checks passed
@ashutosh16 ashutosh16 deleted the include-builtin branch September 10, 2024 18:57
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.

Allow pre-builtin actions with custom action
3 participants