Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ data:
enableGzip: "true"
quota: '{"organization": -1, "user": -1, "application": -1, "provider": -1}'
logConfig: '{"filename": "logs/casdoor.log", "maxdays": 99999, "perm": "0770"}'
initDataFile: {{ .Values.auth.backend.initDataFile | default "./init_data.json" | quote }}
initDataFile: {{ .Values.auth.backend.initDataFile | default "./init_data.json" | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial | 💤 Low value

Consider splitting the quote addition into a separate commit.

While adding quote to initDataFile is a good practice, it's technically a separate change from the initDataNewOnly addition. The quote function ensures proper YAML escaping, but this modification could have been isolated for clarity.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/plugin-access-manager/templates/auth-backend/configmap.yaml` at line
22, The change mixes adding the quote function to the template with the
unrelated initDataNewOnly change; revert the quote addition on the initDataFile
template line (the expression using initDataFile) in this PR so only
initDataNewOnly is included, then create a follow-up commit that solely updates
initDataFile to use {{ .Values.auth.backend.initDataFile | default
"./init_data.json" | quote }} to ensure YAML escaping; reference the template
key initDataFile when making these commits to keep the changes isolated and
clear.

initDataNewOnly: {{ .Values.auth.backend.initDataNewOnly | default "true" | quote }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if initDataNewOnly is documented in values.yaml

# Search for initDataNewOnly in values.yaml files
fd -t f 'values.yaml' charts/plugin-access-manager/ --exec rg -n 'initDataNewOnly' {} \;

# Also check for the auth.backend.initDataNewOnly path
fd -t f 'values.yaml' charts/plugin-access-manager/ --exec cat {} \; | grep -A5 -B5 'backend:' | grep -i 'initData'

Repository: LerianStudio/helm

Length of output: 43


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# 1) Find all usages of initDataNewOnly anywhere in the repo
echo "== RG initDataNewOnly =="
rg -n --hidden --no-ignore initDataNewOnly . || true

# 2) Locate values.yaml files for this chart (and nearby charts)
echo
echo "== values.yaml files under charts/plugin-access-manager =="
fd -t f 'values.yaml' charts/plugin-access-manager --full-path

# 3) For each discovered values.yaml under that chart, show whether auth.backend exists
echo
echo "== auth.backend section context in chart values.yaml files =="
while IFS= read -r f; do
  echo "--- $f ---"
  # Show lines around "auth:" and "backend:" and "initData"
  rg -n '(^|[[:space:]])auth:|(^|[[:space:]])backend:' "$f" || true
  rg -n 'initData' "$f" || true
done < <(fd -t f 'values.yaml' charts/plugin-access-manager --full-path)

# 4) Also check chart-level defaults if they exist elsewhere (e.g., values/*.yaml)
echo
echo "== Any files under plugin-access-manager named values*.yaml =="
fd -t f 'values*.ya?ml' charts/plugin-access-manager --full-path

Repository: LerianStudio/helm

Length of output: 485


🏁 Script executed:

#!/bin/bash
set -euo pipefail

VALUES_FILE="charts/plugin-access-manager/values.yaml"

echo "== initDataNewOnly in values.yaml =="
rg -n 'initDataNewOnly' "$VALUES_FILE" || true

echo
echo "== auth.backend block vicinity in values.yaml =="
# Print a small window around any auth/backend occurrence
rg -n '(^|[[:space:]])auth:|(^|[[:space:]])backend:' "$VALUES_FILE" || true

echo
echo "== Attempt to show lines around auth/backend keys (if present) =="
# If file is small enough, show a larger slice for manual reading
python3 - <<'PY'
import itertools
path="charts/plugin-access-manager/values.yaml"
with open(path,'r',encoding='utf-8') as f:
    lines=f.readlines()
# Print up to first 200 lines (usually enough for auth config in values.yaml)
for i,line in enumerate(lines[:200], start=1):
    if any(k in line for k in ["auth:", "backend:", "initData"]):
        print(f"{i:4d}:{line.rstrip()}")
PY

Repository: LerianStudio/helm

Length of output: 339


🏁 Script executed:

#!/bin/bash
set -euo pipefail

VALUES_FILE="charts/plugin-access-manager/values.yaml"

echo "== initData occurrences in values.yaml =="
rg -n 'initData' "$VALUES_FILE" || true

echo
echo "== Show auth/backend sections around the reported lines =="
# Dump ~60 lines around each occurrence of "backend:" and each "auth:" occurrence after/before
python3 - <<'PY'
path="charts/plugin-access-manager/values.yaml"
with open(path,'r',encoding='utf-8') as f:
    lines=f.readlines()

def dump_around(center, half=35):
    start=max(center-half,1)
    end=min(center+half,len(lines))
    for i in range(start,end+1):
        print(f"{i:4d}:{lines[i-1].rstrip()}")

for c in [144, 289, 383, 424]:
    print("\n--- context around", c, "---")
    dump_around(c, half=35)
PY

Repository: LerianStudio/helm

Length of output: 9705


Document .Values.auth.backend.initDataNewOnly in charts/plugin-access-manager/values.yaml
The template sets:

initDataNewOnly: {{ .Values.auth.backend.initDataNewOnly | default "true" | quote }}

…but charts/plugin-access-manager/values.yaml does not define auth.backend.initDataNewOnly under the existing auth.backend: block (so the option is undocumented). Add the key with a description of what it controls (preserving API/UI-managed state on restart).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/plugin-access-manager/templates/auth-backend/configmap.yaml` at line
23, Add a documented default for the missing values key by editing the chart
values file to include auth.backend.initDataNewOnly with a clear description and
a default value (true), explaining it controls whether API/UI-managed state is
preserved across restarts; place it under the existing auth.backend block near
related backend settings so templating (.Values.auth.backend.initDataNewOnly)
finds the documented default and users understand the purpose (preserve
API/UI-managed state on restart).

Loading