Skip to content
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

Remove unused configuration keys #10730

Merged
merged 1 commit into from
May 31, 2024
Merged

Remove unused configuration keys #10730

merged 1 commit into from
May 31, 2024

Conversation

aduth
Copy link
Member

@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
2 checks passed
@aduth aduth deleted the aduth-rm-unused-config-keys branch May 31, 2024 14:00
colter-nattrass pushed a commit that referenced this pull request Jun 3, 2024
changelog: Internal, Configuration, Remove unused configuration keys
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