Skip to content

Remove unused configuration keys#10730

Merged
aduth merged 1 commit intomainfrom
aduth-rm-unused-config-keys
May 31, 2024
Merged

Remove unused configuration keys#10730
aduth merged 1 commit intomainfrom
aduth-rm-unused-config-keys

Conversation

@aduth
Copy link
Contributor

@aduth aduth commented May 31, 2024

🛠 Summary of changes

Removes unused configuration keys in application.yml.default / IdentityConfig:

I was hoping to introduce some automated testing to identify these keys in continuous integration (see 276fbbc), but it didn't work as expected. I'm not sure it could work, since specs are parallelized across many runners, so each individual runner doesn't have access to a global shared pool of tracked calls to config methods.

Instead, I put together a bash script to identify unused keys:

rails runner ['File.write("keys.txt", IdentityConfig.store.to_h.keys.join("\n"))']

while read key; do
  hits=$(ag "$key" . --nofilename --nobreak --ignore-dir={node_modules,tmp,public} --ignore={keys.txt,config/application.yml.default,lib/identity_config.rb} | wc -l)
  if [ "$hits" -eq "0" ]; then
    echo "$key"
  fi
done < keys.txt

📜 Testing Plan

Verify there are no references to the removed configuration keys.

changelog: Internal, Configuration, Remove unused configuration keys
@aduth aduth requested a review from eileen-nava May 31, 2024 13:49
@aduth aduth merged commit 1ee9f2c into main May 31, 2024
@aduth aduth deleted the aduth-rm-unused-config-keys branch May 31, 2024 14:00
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