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

fix(controller): expressions: fix quote() of a json object #3111

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

krancour
Copy link
Member

Fixes #3109

cc @muenchdo thanks for discovering this issue.

Copy link

netlify bot commented Dec 10, 2024

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit a49097c
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-io/deploys/6757d19900e896000873a94f
😎 Deploy Preview https://deploy-preview-3111.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 51.14%. Comparing base (ad9e16f) to head (a49097c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
internal/expressions/json_templates.go 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3111      +/-   ##
==========================================
- Coverage   51.14%   51.14%   -0.01%     
==========================================
  Files         283      283              
  Lines       25474    25479       +5     
==========================================
+ Hits        13028    13030       +2     
- Misses      11752    11754       +2     
- Partials      694      695       +1     

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

@muenchdo
Copy link
Contributor

Thanks for the quick fix! I'd say JSON bodies are such a common use case that it's worth having an explicit example. Maybe here? Or what you commented is also great.

@krancour
Copy link
Member Author

Thanks for the quick fix! I'd say JSON bodies are such a common use case that it's worth having an explicit example.

Totally agree. The example of posting to Slack is probably a good place for this. Knocking this down to a draft until I can fix that in the morning.

@krancour krancour marked this pull request as draft December 10, 2024 05:18
Signed-off-by: Kent Rancourt <[email protected]>
@krancour
Copy link
Member Author

Fixed the Slack example.

@krancour krancour marked this pull request as ready for review December 10, 2024 05:29
@@ -1452,8 +1455,8 @@ steps:
- name: Content-Type
value: application/json
body: |
{
"channel": ${{ vars.slackChannel }},
${{ quote({
Copy link
Member Author

Choose a reason for hiding this comment

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

The existing example was actually wrong without this.

@krancour krancour added this pull request to the merge queue Dec 10, 2024
Merged via the queue into akuity:main with commit 019169f Dec 10, 2024
16 of 17 checks passed
@krancour krancour deleted the krancour/quote-func-fix branch December 10, 2024 14:47
github-actions bot pushed a commit that referenced this pull request Dec 10, 2024
@akuitybot
Copy link

Successfully created backport PR for release-1.1:

fykaa pushed a commit to fykaa/kargo that referenced this pull request Dec 20, 2024
fykaa pushed a commit to fykaa/kargo that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON body in HTTP promotion step causes schema validation failure
4 participants