Replace legacy Chocolatey Community Repository on upgrade
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Currently when upgrading Chocolatey, the configuration file is left largely alone. Since the community repository has been moved to `https://community.chocolatey.org/api/v2/`, it would be beneficial to change this source on upgrade if it's in there as one of the old (or possibly manually updated and slightly incorrect) incarnations `http[s]://chocolatey.org/api/v2[/]` or `http[s]://community.chocolatey.org/api/v2[^/]`.
Thinking about this, a naive check could simply be something like:
```powershell
if ($source -match 'chocolatey.org/api/v2' -and $source -notmatch 'https://community.chocolatey.org/api/v2/')
{
# Handle correcting the source
}
```
## Reason for this change
If we ever opt to change the redirect behaviour in the future, this will ensure nothing breaks.
Contributor guide
Research direction
The issue names no files or tests. Start by locating the upgrade path that reads and writes the configuration source, then trace where repository URLs are handled; done means each listed legacy or slightly incorrect URL is normalized to https://community.chocolatey.org/api/v2/ during upgrade without changing unrelated sources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100