-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Package Feature Detection #181
Conversation
Is it worth expanding this to autocomplete providers? |
Appreciate you checking up on this one, and I don't think we need to. Since any autocomplete information should be able to be on the package's |
scripts/tools/feature-detection.js
Outdated
return { ok: true, content: command[0] }; | ||
} | ||
|
||
async function getVersions(pointer) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
scripts/tools/feature-detection.js
Outdated
return { ok: true, content: command }; | ||
} | ||
|
||
async function getLatestVersion(pointer) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
scripts/tools/feature-detection.js
Outdated
return res; | ||
} | ||
|
||
function twirlTimer(control) { |
Check notice
Code scanning / CodeQL
Unused variable, import, function or class Note
scripts/tools/feature-detection.js
Outdated
console.log(`Exiting any and all feature checks because we have hit our unused rate limit of ${UNUSED_RATE_LIMIT} with ${RATE_LIMIT_REMAINING} api hits left.`); | ||
await sqlEnd(); | ||
process.exit(1); | ||
} else { |
Check warning
Code scanning / CodeQL
Unreachable statement Warning
Finally getting back to this somewhat, for my own future reference have created the additional tables needed with: ALTER TABLE versions ADD supported_languages VARCHAR(256) ARRAY
ALTER TABLE versions ADD has_snippets BOOLEAN NOT NULL DEFAULT FALSE
ALTER TABLE versions ADD has_grammar BOOLEAN NOT NULL DEFAULT FALSE |
This commit adds: - API docs update - Source Code docs update - Database support - API support - Tests
I know it has taken way too long, but I'd like to add, I've finished running feature detection for every currently existing package. This PR is now ready to be merged after a final review, and we can get this feature out. |
Awesome. I'd love to see UI for this eventually — some sidebar or info box with a list of services provided/consumed, plus names and scope names of provided grammars, etc. |
Requirements
Filling out the template is required.
All new code requires tests to ensure against regressions.
Have you ran tests against this code?
This PR contains zero code changes.
Description of the Change
The goal of this PR is to bring feature detection to the backend.
That will initially start off with the
./scripts/tools/feature-detection.js
script that will preform feature detection on all currently published packages, then the code changes will implement the same behavior into the backend to be preformed once a package is published or a new version is published.Feature Detection refers to checking a few different 'features' of a package on the repository. This includes the following:
This is mainly aimed at collecting the last part here, as once we know what file extensions are supported by any one grammar, we can then implement an endpoint or a filter that allows Pulsar to automatically search for a grammar for any file extension it finds it doesn't have support for.
The other parts of data being collected is purely a way to allow more badges to be applied to packages