Skip to content

feat: add centralized branding configuration#670

Merged
irumvanselme merged 1 commit into
mainfrom
feat/branding-config-KS-15
Feb 5, 2026
Merged

feat: add centralized branding configuration#670
irumvanselme merged 1 commit into
mainfrom
feat/branding-config-KS-15

Conversation

@Fidesnoella

Copy link
Copy Markdown
Contributor

No description provided.

@Fidesnoella
Fidesnoella force-pushed the feat/branding-config-KS-15 branch 2 times, most recently from 3b45d22 to 8890d8f Compare February 4, 2026 06:46
Comment thread frontend-new/src/_test_utilities/envServiceMock.ts
@Fidesnoella
Fidesnoella force-pushed the feat/branding-config-KS-15 branch 2 times, most recently from 22f7887 to d067bd3 Compare February 4, 2026 15:39
Comment thread config/inject-config.py
@irumvanselme
irumvanselme force-pushed the feat/branding-config-KS-15 branch from d067bd3 to d8074bf Compare February 5, 2026 06:30
@irumvanselme
irumvanselme force-pushed the feat/branding-config-KS-15 branch from d8074bf to 23606c7 Compare February 5, 2026 06:31
Comment thread config/inject-config.py

def extract_existing_frontend_json_value(content: str, key: str) -> Dict[str, Any]:
"""Extract the existing JSON.stringify payload for a key in env.js"""
pattern = rf'(?:"{re.escape(key)}"|{re.escape(key)}):\s*btoa\(\s*JSON\.stringify\((.*?)\)\s*\),'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The regex pattern in extract_existing_frontend_json_value uses non-greedy matching (.*?) which will fail if a JSON string value contains a closing parenthesis ).
Severity: HIGH

Suggested Fix

The regex needs to be more robust to handle nested parentheses. Instead of relying on a non-greedy match to the first parenthesis, the pattern should correctly parse the balanced parentheses of the JSON.stringify() call. This might involve a more complex regex or a different parsing strategy that doesn't rely on regex for structured data.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: config/inject-config.py#L143

Potential issue: The regex patterns at lines 143 and 202-204 use non-greedy matching
`(.*?)` to extract and replace JSON values. If a user-provided string value within the
JSON, such as a `description`, contains a closing parenthesis (e.g., "See our FAQ
(info)"), the regex will match incorrectly. This causes
`extract_existing_frontend_json_value()` to fail silently and return an empty
dictionary. Consequently, the script will fail to replace the existing configuration
line and will instead insert a new, duplicate line, leading to a corrupted `env.js` file
and potential data loss for existing keys.

@irumvanselme
irumvanselme merged commit 8c103d8 into main Feb 5, 2026
8 checks passed
@irumvanselme
irumvanselme deleted the feat/branding-config-KS-15 branch February 5, 2026 06:48
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