Skip to content

deployment: add rules formatter makefile command to force literal style for rule summary and description - #1627

Open
jiekun wants to merge 7 commits into
masterfrom
feature/rules-formatter
Open

deployment: add rules formatter makefile command to force literal style for rule summary and description#1627
jiekun wants to merge 7 commits into
masterfrom
feature/rules-formatter

Conversation

@jiekun

@jiekun jiekun commented Jul 24, 2026

Copy link
Copy Markdown
Member

add rules formatter makefile command to force literal style for rule summary and description

@jiekun
jiekun requested a review from AndrewChubatiuk July 27, 2026 05:15
@jiekun

jiekun commented Jul 27, 2026

Copy link
Copy Markdown
Member Author

Hi I'd like to invite @AndrewChubatiuk to the 1st round review as you have extensive experience playing with the helm and template and probably yaml. Open to any suggestion / correction. <3

Comment thread deployment/docker/rules/alerts-health.yml Outdated
Comment thread deployment/docker/rules/alerts-health.yml
@jiekun
jiekun marked this pull request as ready for review July 27, 2026 05:42
@jiekun
jiekun requested a review from AndrewChubatiuk July 27, 2026 05:42

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found across 5 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="deployment/docker/rules/Makefile">

<violation number="1" location="deployment/docker/rules/Makefile:7">
P2: `format-rules` can report success after a formatting failure in any non-final file because the loop does not propagate `yq`'s failure status. Propagating the error from each `yq` invocation would prevent partially formatted rules from being mistaken for a successful run.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread deployment/docker/rules/Makefile
format-rules:
find $(RULES_DIR) -type f -name "*.yml" | while IFS= read -r f; do \
echo "Processing $${f}"; \
yq -i '.groups[].rules[].annotations.summary style="literal" | .groups[].rules[].annotations.description style="literal"' "$${f}"; \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2: format-rules can report success after a formatting failure in any non-final file because the loop does not propagate yq's failure status. Propagating the error from each yq invocation would prevent partially formatted rules from being mistaken for a successful run.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At deployment/docker/rules/Makefile, line 7:

<comment>`format-rules` can report success after a formatting failure in any non-final file because the loop does not propagate `yq`'s failure status. Propagating the error from each `yq` invocation would prevent partially formatted rules from being mistaken for a successful run.</comment>

<file context>
@@ -0,0 +1,8 @@
+format-rules:
+	find $(RULES_DIR) -type f -name "*.yml" | while IFS= read -r f; do \
+		echo "Processing $${f}"; \
+		yq -i '.groups[].rules[].annotations.summary style="literal" | .groups[].rules[].annotations.description style="literal"' "$${f}"; \
+	done
</file context>
Suggested change
yq -i '.groups[].rules[].annotations.summary style="literal" | .groups[].rules[].annotations.description style="literal"' "$${f}"; \
yq -i '.groups[].rules[].annotations.summary style="literal" | .groups[].rules[].annotations.description style="literal"' "$${f}" || exit 1; \

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.

2 participants