-
Notifications
You must be signed in to change notification settings - Fork 24
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
(BSR) ci(env): check variables in env files #6318
Conversation
Performance Comparison ReportSignificant Changes To Render Duration
Show details
Meaningless Changes To Render DurationShow entries
Show details
Changes To Render CountThere are no entries Added ScenariosThere are no entries Removed ScenariosThere are no entries |
4ae40d9
to
4e36579
Compare
.github/workflows/dev_on_pull_request_missing_variables_in_env_files.yml
Outdated
Show resolved
Hide resolved
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.
des commentaires non obligatoires mais qui pourraient améliorer
const missing: Record<string, string[]> = {} | ||
for (const [file, data] of Object.entries(envData)) { | ||
missing[file] = Array.from(allKeys).filter((x) => !data.includes(x)) | ||
} |
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.
Les Set ont des méthodes pour les comparer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set#set_composition
j'ai l'impression que A.symmetricDifference(B) répondrait au besoin
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.
} | ||
|
||
function compareEnvFiles(envFiles: string[]) { | ||
const envData: Record<string, string[]> = {} |
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.
j'ai l'impression qu'il pourrait etre intéressant d'avoir un Set
en valeur
const envData: Record<string, string[]> = {} | |
const envData: Record<string, Set<string>> = {} |
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.
Si on avait la méthode Set.union et Set.symetricDifference, carrément, mais ce n'est pas le cas en NodeJS, donc c'est + simple avec un array :/
d33f120
to
61380ed
Compare
Quality Gate passedIssues Measures |
Quality Gate passedIssues Measures |
Exemple de message de la CI :