-
Notifications
You must be signed in to change notification settings - Fork 103
WIP: Migrating from bespoke 's3Configs' that where assotiated to a wo… #1038
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
Changes from all commits
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 |
|---|---|---|
| @@ -1 +1,57 @@ | ||
| export * from "./s3Client"; | ||
|
|
||
| const x = { | ||
| workingDirectory: { | ||
| bucketMode: "multi", | ||
| bucketNamePrefix: "", | ||
| bucketNamePrefixGroup: "projet-" | ||
| }, | ||
| bookmarkedDirectories: [ | ||
| { | ||
| fullPath: "donnees-insee/diffusion/", | ||
| title: { | ||
| fr: "Données de diffusion", | ||
| en: "Dissemination Data" | ||
| }, | ||
| description: { | ||
| fr: "Bucket public destiné à la diffusion de données", | ||
| en: "Public bucket intended for data dissemination" | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
| const s3 = { | ||
| bookmarkedDirectories: [ | ||
| { | ||
| fullPath: "$1/", | ||
| title: "Personal", | ||
| description: "Personal storage", | ||
| claimName: "preferred_username" | ||
| }, | ||
| { | ||
| fullPath: "projet-$1/", | ||
| title: "Group $1", | ||
| description: "Shared storage for project $1", | ||
| claimName: "groups", | ||
| excludedClaimPattern: "^USER_ONYXIA$" | ||
| }, | ||
| { | ||
| fullPath: "donnees-insee/diffusion/", | ||
| title: { | ||
| fr: "Données de diffusion", | ||
| en: "Dissemination Data" | ||
| }, | ||
| description: { | ||
| fr: "Bucket public destiné à la diffusion de données", | ||
| en: "Public bucket intended for data dissemination" | ||
| } | ||
| } | ||
| ] | ||
| }; | ||
|
Comment on lines
+23
to
+50
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainRemove or properly utilize the unused constant. The constant Consider one of the following actions:
Run the following script to verify this constant is not referenced elsewhere: 🏁 Script executed: #!/bin/bash
# Description: Search for any references to the constant 's3' from this module.
# Search for imports or usage of this constant
rg -n --type=ts --type=tsx 'from.*s3Client.*\bs3\b|s3Client\.\bs3\b' -g '!web/src/core/adapters/s3Client/index.ts'Length of output: 27 🏁 Script executed: #!/bin/bash
# Description: Search for any references to the constant 's3' from this module.
# Search for import statements or usage of s3Client across TS and TSX files
rg -n "s3Client" -g "*.ts" -g "*.tsx" -g "!web/src/core/adapters/s3Client/index.ts"Length of output: 6225 Remove or export the unused The 🤖 Prompt for AI Agents |
||
|
|
||
| /* | ||
| */ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,12 +10,10 @@ type State = { | |
|
|
||
| export type OngoingConfigTest = { | ||
| paramsOfCreateS3Client: ParamsOfCreateS3Client; | ||
| workingDirectoryPath: string; | ||
| }; | ||
|
|
||
| export type ConfigTestResult = { | ||
| paramsOfCreateS3Client: ParamsOfCreateS3Client; | ||
| workingDirectoryPath: string; | ||
| result: | ||
| | { | ||
| isSuccess: true; | ||
|
|
@@ -43,20 +41,17 @@ export const { actions, reducer } = createUsecaseActions({ | |
| payload: State["ongoingConfigTests"][number]; | ||
| } | ||
| ) => { | ||
| const { paramsOfCreateS3Client, workingDirectoryPath } = payload; | ||
| const { paramsOfCreateS3Client } = payload; | ||
|
|
||
| if ( | ||
| state.ongoingConfigTests.find(e => | ||
| same(e, { paramsOfCreateS3Client, workingDirectoryPath }) | ||
| same(e, { paramsOfCreateS3Client }) | ||
| ) !== undefined | ||
| ) { | ||
| return; | ||
| } | ||
|
|
||
| state.ongoingConfigTests.push({ | ||
| paramsOfCreateS3Client, | ||
| workingDirectoryPath | ||
| }); | ||
| state.ongoingConfigTests.push({ paramsOfCreateS3Client }); | ||
| }, | ||
|
Comment on lines
+44
to
55
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion | 🟠 Major 🧩 Analysis chainKeying by paramsOfCreateS3Client only — LGTM. Deep-compare usage is correct; dedupe and replace semantics look right. Run to spot stale references to workingDirectoryPath: Also applies to: 64-85 🏁 Script executed: #!/usr/bin/env bash
rg -n --type=ts --type=tsx -C2 '\bworkingDirectoryPath\b'Length of output: 27 🏁 Script executed: #!/usr/bin/env bash
rg -n '\bworkingDirectoryPath\b' -C2 .Length of output: 22376 Remove stale 🤖 Prompt for AI Agents |
||
| testCompleted: ( | ||
| state, | ||
|
|
@@ -66,11 +61,11 @@ export const { actions, reducer } = createUsecaseActions({ | |
| payload: State["configTestResults"][number]; | ||
| } | ||
| ) => { | ||
| const { paramsOfCreateS3Client, workingDirectoryPath, result } = payload; | ||
| const { paramsOfCreateS3Client, result } = payload; | ||
|
|
||
| remove_from_ongoing: { | ||
| const entry = state.ongoingConfigTests.find(e => | ||
| same(e, { paramsOfCreateS3Client, workingDirectoryPath }) | ||
| same(e, { paramsOfCreateS3Client }) | ||
| ); | ||
|
|
||
| if (entry === undefined) { | ||
|
|
@@ -84,10 +79,8 @@ export const { actions, reducer } = createUsecaseActions({ | |
| } | ||
|
|
||
| remove_existing_result: { | ||
| const entry = state.configTestResults.find( | ||
| e => | ||
| same(e.paramsOfCreateS3Client, paramsOfCreateS3Client) && | ||
| e.workingDirectoryPath === workingDirectoryPath | ||
| const entry = state.configTestResults.find(e => | ||
| same(e.paramsOfCreateS3Client, paramsOfCreateS3Client) | ||
| ); | ||
|
|
||
| if (entry === undefined) { | ||
|
|
@@ -99,7 +92,6 @@ export const { actions, reducer } = createUsecaseActions({ | |
|
|
||
| state.configTestResults.push({ | ||
| paramsOfCreateS3Client, | ||
| workingDirectoryPath, | ||
| result | ||
| }); | ||
| } | ||
|
|
||
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.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Remove or export the unused constant.
The constant
xis defined but not exported, making it inaccessible to other modules. The non-descriptive name and lack of usage suggest this is development scaffolding that should be removed.Run the following script to verify this constant is not referenced elsewhere:
🏁 Script executed:
Length of output: 27
Run the following script to verify there are no references to the constant
x:🏁 Script executed:
Length of output: 353
Run the following script to verify there are no references to the constant
x:🏁 Script executed:
Length of output: 256
Remove unused constant
xThe constant
xis defined but never exported or referenced; remove it or rename and export it if it’s required.🤖 Prompt for AI Agents