-
Notifications
You must be signed in to change notification settings - Fork 94
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
Warns users about non-ghcup channels #1230
base: master
Are you sure you want to change the base?
Conversation
@qxrein Thanks for the PR! In addition to using these official channels, the user could also provide (via ghcup config or command line options) a path to metadata file which does not have the "https://raw.githubusercontent.com/haskell/ghcup-metadata/" prefix. in this scenario we should warn users. Also you may want to join the matrix chat (https://matrix.to/#/#ghcup:matrix.org) for more casual discussions on ghcup related dev |
ok |
this is working after introducing a random temporary channel to
|
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.
There are a few changes necessary, and please remove the code which is not used anywhere
226fc87
to
0928e45
Compare
not (any (`isPrefixOf` url) officialPrefixes) || | ||
url == "https://ghc.gitlab.haskell.org/ghcup-metadata/ghcup-nightlies-0.0.7.yaml") $ | ||
logWarn $ "The URL " <> T.pack url <> " is not an official GHCup metadata source and may not be maintained or QA'd by GHCup." | ||
when (not (isOfficialURI uri) || isNightliesURI uri) $ |
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.
- we do not want to emit a warning every time a download is issued... instead we want to emit a warning if a user adds a new channel (either via
ghcup config add-release-channel
orghcup config set url-source
) - nightlies are no exception... they are not maintained by GHCup, so we want to warn
, "https://mirror.sjtu.edu.cn/ghcup/yaml/haskell/ghcup-metadata/" | ||
] | ||
-- | Logic to check if it is an Official Channel | ||
isOfficialURI :: URI -> Bool |
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.
This will trigger on file://
URLs... which we don't want.
bd8b777
to
11e12c4
Compare
RESOLVES: #1225
example output