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

Handle No Local Schema Files #505

Merged
merged 5 commits into from
Dec 11, 2024
Merged

Handle No Local Schema Files #505

merged 5 commits into from
Dec 11, 2024

Conversation

henryfauna
Copy link
Contributor

@henryfauna henryfauna commented Dec 11, 2024

Ticket(s): FE-6217

Problem

When no local schema files are found schema status tells the user that everything will be removed.

Solution

Detect if no files were found and output a message to that effect instead.

Result

Users will know that they have specified the wrong schema directory.

Screenshot 2024-12-10 at 4 57 12 PM

Testing

Updated & added tests.

@henryfauna henryfauna changed the title No local schema Handle No Local Schema Files Dec 11, 2024
@henryfauna henryfauna marked this pull request as ready for review December 11, 2024 01:02
@henryfauna henryfauna requested a review from a team as a code owner December 11, 2024 01:02
const gatherFSL = container.resolve("gatherFSL");
const fsl = reformatFSL(await gatherFSL(argv.dir));

const hasLocalSchema = fsl.entries().next().done === false;

const statusParams = new URLSearchParams({ diff: "summary" });
Copy link
Contributor

@ptpaterson ptpaterson Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no diff param documented for /status or /diff endpoints. Maybe that's an old value? Is the format: "summary" the param you want?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can confirm — format is the new alias for diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool - I've updated the command to use format as well as the expectation in the tests

Copy link
Contributor

@jrodewig jrodewig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good aside from a minor test suggestion.

test/schema/status.mjs Outdated Show resolved Hide resolved
Co-authored-by: James Rodewig <[email protected]>
@henryfauna henryfauna merged commit 69a1217 into v3 Dec 11, 2024
4 checks passed
@henryfauna henryfauna deleted the no-local-schema branch December 11, 2024 17:23
@cleve-fauna cleve-fauna mentioned this pull request Dec 13, 2024
@mwilde345 mwilde345 mentioned this pull request Dec 18, 2024
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.

4 participants