Skip to content

Ensure Template Rendering for All Analysis Stage Strategies#6010

Merged
ffjlabo merged 1 commit into
pipe-cd:masterfrom
mohammedfirdouss:analysis-template-rendering
Jul 8, 2025
Merged

Ensure Template Rendering for All Analysis Stage Strategies#6010
ffjlabo merged 1 commit into
pipe-cd:masterfrom
mohammedfirdouss:analysis-template-rendering

Conversation

@mohammedfirdouss
Copy link
Copy Markdown
Contributor

Summary

This MR ensures that all ANALYSIS stage strategies (including THRESHOLD and PREVIOUS) render their query templates before use, just like CANARY_BASELINE already does.

Why

Previously, template variables (e.g., {{ .App.Name }}) were not rendered for THRESHOLD and PREVIOUS strategies, resulting in raw template strings in logs and queries.
This change unifies the behavior and ensures all strategies support dynamic values, improving log clarity and query correctness.

How

  • Updated metrics_analyzer.go to use renderQuery for all strategies.

Impact

  • Users will now see actual values instead of template variables in logs and queries for all analysis strategies.

Related Issue

Closes #6005

@mohammedfirdouss mohammedfirdouss requested a review from a team as a code owner July 6, 2025 14:16
@mohammedfirdouss mohammedfirdouss changed the title nsure Template Rendering for All Analysis Stage Strategies Ensure Template Rendering for All Analysis Stage Strategies Jul 6, 2025
@mohammedfirdouss
Copy link
Copy Markdown
Contributor Author

@Warashi I think this is ready for a review?

@Warashi Warashi self-assigned this Jul 7, 2025
@Warashi
Copy link
Copy Markdown
Member

Warashi commented Jul 7, 2025

@mohammedfirdouss
Please sign off your commits.
You can follow the instructions written on this page.
https://github.com/pipe-cd/pipecd/pull/6010/checks?check_run_id=45427769775

Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

The changes is LGTM.

I checked the behavior with the THRESHOLD strategy, which seems good.

A screenshot from the stage logs with the latest piped.
Image

A screenshot from the stage logs with this PR.
Image

@mohammedfirdouss
Copy link
Copy Markdown
Contributor Author

@Warashi Thanks for that. I would check it out.

@mohammedfirdouss mohammedfirdouss force-pushed the analysis-template-rendering branch from 4a9c67b to fe89c8e Compare July 7, 2025 08:23
Signed-off-by: mohammedfirdouss <mohammedfirdousaraoye@gmail.com>
@mohammedfirdouss mohammedfirdouss force-pushed the analysis-template-rendering branch from fe89c8e to 1a8ed9c Compare July 7, 2025 08:29
Copy link
Copy Markdown
Member

@Warashi Warashi left a comment

Choose a reason for hiding this comment

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

Thank you! LGTM

Copy link
Copy Markdown
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! LGTM!

@ffjlabo ffjlabo merged commit 69ce763 into pipe-cd:master Jul 8, 2025
37 checks passed
@mohammedfirdouss
Copy link
Copy Markdown
Contributor Author

@Warashi @ffjlabo, are there any other issues you would recommend for me to work on?

github-actions Bot pushed a commit that referenced this pull request Jul 14, 2025
Signed-off-by: mohammedfirdouss <mohammedfirdousaraoye@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
This was referenced Jul 14, 2025
github-actions Bot pushed a commit that referenced this pull request Jul 14, 2025
Signed-off-by: mohammedfirdouss <mohammedfirdousaraoye@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
ffjlabo added a commit that referenced this pull request Jul 14, 2025
* refactor metricsAnalyzer to render queries before execution. (#6010)

Signed-off-by: mohammedfirdouss <mohammedfirdousaraoye@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* Update piped-base container image version (#6018)

Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* Update piped-base-okd image for piped and launcher (#6023)

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

* Cut release v0.52.2 (#6027)

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ffjlabo <40124947+ffjlabo@users.noreply.github.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>

---------

Signed-off-by: mohammedfirdouss <mohammedfirdousaraoye@gmail.com>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mohammed Firdous <124298708+mohammedfirdouss@users.noreply.github.com>
Co-authored-by: Khanh Tran <32532742+khanhtc1202@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ffjlabo <40124947+ffjlabo@users.noreply.github.com>
@t-kikuc t-kikuc mentioned this pull request Jul 29, 2025
8 tasks
@mohammedfirdouss mohammedfirdouss deleted the analysis-template-rendering branch July 31, 2025 09:51
@github-actions github-actions Bot mentioned this pull request Aug 15, 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.

Analysis stage with THRESHOLD or PREVIOUS doesn't evaluate Go template in AnalysisTemplate

3 participants