-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Deprecate magic resolving of cdnjs and github "URLs" #3671
Conversation
ef00e02
to
e7ba6a8
Compare
Unfortunately adding a test in cmd/tests (where it seemed most relevant) hits the check that no goroutines are still alive at the end of the test. There are alive goroutines as the test actually hits the network and uses http2 to get the code. Unfortunately it also uses the default client and calling Rewriting this so it can be more easily tested seems like quite a lot of work that also will mostly be thrown away once we have it removed so ... I decided not to go down this path. Due to the way this is called internally the message is only printed once. It also doesn't get printed when running the archive, which might require additional code changes. But does get printed when creating the archive or running |
Co-authored-by: Oleg Bespalov <oleg.bespalov@grafana.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3671 +/- ##
==========================================
- Coverage 73.61% 73.54% -0.08%
==========================================
Files 277 275 -2
Lines 20247 20246 -1
==========================================
- Hits 14905 14890 -15
- Misses 4396 4404 +8
- Partials 946 952 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
loader/github.go
Outdated
const magicURLsDeprecationWarning = "Specifier %q resolved to use a non-conventional %s loader. " + | ||
"That loader is deprecated and will be removed in v0.53.0. Please use the real URL %q instead." |
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.
const magicURLsDeprecationWarning = "Specifier %q resolved to use a non-conventional %s loader. " + | |
"That loader is deprecated and will be removed in v0.53.0. Please use the real URL %q instead." | |
const magicURLsDeprecationWarning = "Specifier %q was resolved by a non-conventional %s loader. " + | |
"The used %q loader is deprecated and will be removed in k6 v0.53.0. Please, use the real URL %q instead." |
In any case, my feeling is that non-conventional
isn't clear enough information. Is there a de-facto list of conventional loaders for JavaScript that I'm not aware of?
I don't think we define somewhere the k6 conventional (supported?) loaders. We should explicit them here or in the documentation.
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 isn't - and there is no documentation about cdnjs and github loaders for years at this point - we did drop it from every documentation like 3+ years ago.
I do agree - but IMO us making this message be more specific likely will have no benefit. I have not seen anyone use the github ones ever and the cdnjs ones seems to be used very rarely.
So my expectation is most people will never see this message.
If you have a concrete simple fix - I am all for it, but my only other proposal was "magic" (with quotes) and I think that is even less obvious.
I would also argue that most people will agree that pure paths and URLs are the "conventional" specifiers even if the specification has left this completely unspecified 😉 😉
I did redo practically the whole code so:
I do think it migth be better to also link the original issue in the message, maybe as a way to also expand on the "non-conventional loader" term? |
As of now, the loader name is returned as part of the message, I find the current version enough. As we defined it as a rare case, I don't think we need more. What is wrong and what should be done to fix it should be clear to the user. In any case, if you want to add it, I'm not against it. |
What?
Deprecate magic resolving of cdnjs and github "URLs"
Why?
As part of #1408 we are first going to deprecate it for a couple of versions and then remove it.
Checklist
make lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
#1408