-
Couldn't load subscription status.
- Fork 687
feat: support multiple SSM parameters for large runner matcher configs (#4790) #4792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
2d5991f
85df592
4af61cf
9c22d0b
214ca91
06c1dcc
2259aaf
40e2a53
bc9eb93
b6e68d7
367d51e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -87,17 +87,44 @@ abstract class BaseConfig { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export class ConfigWebhook extends BaseConfig { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| repositoryAllowList: string[] = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| abstract class MatcherAwareConfig extends BaseConfig { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matcherConfig: RunnerMatcherConfig[] = []; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| protected async loadMatcherConfig(paramPathsEnv: string) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!paramPathsEnv || paramPathsEnv === 'undefined' || paramPathsEnv === 'null' || !paramPathsEnv.includes(':')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await this.loadParameter(paramPathsEnv, 'matcherConfig'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const paths = paramPathsEnv | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .split(':') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .map((p) => p.trim()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| .filter(Boolean); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let combinedString = ''; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for (const path of paths) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| await this.loadParameter(path, 'matcherConfig'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combinedString += this.matcherConfig; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.matcherConfig = JSON.parse(combinedString); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch (error) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| this.configLoadingErrors.push(`Failed to parse combined matcher config: ${(error as Error).message}`); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+94
to
+114
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!paramPathsEnv || paramPathsEnv === 'undefined' || paramPathsEnv === 'null' || !paramPathsEnv.includes(':')) { | |
| await this.loadParameter(paramPathsEnv, 'matcherConfig'); | |
| return; | |
| } | |
| const paths = paramPathsEnv | |
| .split(':') | |
| .map((p) => p.trim()) | |
| .filter(Boolean); | |
| let combinedString = ''; | |
| for (const path of paths) { | |
| await this.loadParameter(path, 'matcherConfig'); | |
| combinedString += this.matcherConfig; | |
| } | |
| try { | |
| this.matcherConfig = JSON.parse(combinedString); | |
| } catch (error) { | |
| this.configLoadingErrors.push(`Failed to parse combined matcher config: ${(error as Error).message}`); | |
| } | |
| if (!paramPathsEnv || paramPathsEnv === 'undefined' || paramPathsEnv === 'null') { | |
| // Optionally, log or handle missing matcher config path | |
| return; | |
| } else if (paramPathsEnv.includes(':')) { | |
| const paths = paramPathsEnv | |
| .split(':') | |
| .map((p) => p.trim()) | |
| .filter(Boolean); | |
| let combinedString = ''; | |
| for (const path of paths) { | |
| await this.loadParameter(path, 'matcherConfig'); | |
| combinedString += this.matcherConfig; | |
| } | |
| try { | |
| this.matcherConfig = JSON.parse(combinedString); | |
| } catch (error) { | |
| this.configLoadingErrors.push(`Failed to parse combined matcher config: ${(error as Error).message}`); | |
| } | |
| } else { | |
| await this.loadParameter(paramPathsEnv, 'matcherConfig'); | |
| } |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code concatenates this.matcherConfig as a string, but matcherConfig is typed as RunnerMatcherConfig[] (an array). This will result in [object Object] being concatenated instead of the JSON string. Should concatenate the parameter value directly or store it in a temporary variable.
| let combinedString = ''; | |
| for (const path of paths) { | |
| await this.loadParameter(path, 'matcherConfig'); | |
| combinedString += this.matcherConfig; | |
| } | |
| try { | |
| this.matcherConfig = JSON.parse(combinedString); | |
| } catch (error) { | |
| this.configLoadingErrors.push(`Failed to parse combined matcher config: ${(error as Error).message}`); | |
| } | |
| let combinedMatcherConfig: RunnerMatcherConfig[] = []; | |
| for (const path of paths) { | |
| await this.loadParameter(path, 'matcherConfig'); | |
| if (Array.isArray(this.matcherConfig)) { | |
| combinedMatcherConfig.push(...this.matcherConfig); | |
| } else { | |
| this.configLoadingErrors.push(`Matcher config at path "${path}" is not an array`); | |
| } | |
| } | |
| this.matcherConfig = combinedMatcherConfig; |
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.