Skip to content

feat: improve argocd compatibility with monorepo#2982

Draft
j-zimnowoda wants to merge 122 commits intomainfrom
APL-1491-2
Draft

feat: improve argocd compatibility with monorepo#2982
j-zimnowoda wants to merge 122 commits intomainfrom
APL-1491-2

Conversation

@j-zimnowoda
Copy link
Copy Markdown
Contributor

📌 Summary

🔍 Reviewer Notes

🧹 Checklist

  • Code is readable, maintainable, and robust.
  • Unit tests added/updated

Comment thread src/cmd/apply-as-apps.ts
): ArgocdAppManifest => {
const name = getAppName(release)
const patch = (appPatches[name] || genericPatch) as Record<string, any>
const chartPath = release.chart.replace('../', '')

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '../'.

Copilot Autofix

AI 4 days ago

Use a global replacement so all ../ occurrences are removed, not just the first.

Best minimal fix in src/cmd/apply-as-apps.ts (line 147 region): replace

  • release.chart.replace('../', '')

with

  • release.chart.replace(/\.\.\//g, '')

This keeps existing functionality (strip parent-directory markers) while making it complete for repeated segments. No new imports, methods, or dependencies are required.

Suggested changeset 1
src/cmd/apply-as-apps.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/src/cmd/apply-as-apps.ts b/src/cmd/apply-as-apps.ts
--- a/src/cmd/apply-as-apps.ts
+++ b/src/cmd/apply-as-apps.ts
@@ -144,7 +144,7 @@
 ): ArgocdAppManifest => {
   const name = getAppName(release)
   const patch = (appPatches[name] || genericPatch) as Record<string, any>
-  const chartPath = release.chart.replace('../', '')
+  const chartPath = release.chart.replace(/\.\.\//g, '')
   return getArgoCdAppManifest(name, ARGOCD_APP_DEFAULT_LABEL, {
     syncPolicy: ARGOCD_APP_DEFAULT_SYNC_POLICY,
     project: 'default',
EOF
@@ -144,7 +144,7 @@
): ArgocdAppManifest => {
const name = getAppName(release)
const patch = (appPatches[name] || genericPatch) as Record<string, any>
const chartPath = release.chart.replace('../', '')
const chartPath = release.chart.replace(/\.\.\//g, '')
return getArgoCdAppManifest(name, ARGOCD_APP_DEFAULT_LABEL, {
syncPolicy: ARGOCD_APP_DEFAULT_SYNC_POLICY,
project: 'default',
Copilot is powered by AI and may make mistakes. Always verify output.
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.

3 participants