-
Notifications
You must be signed in to change notification settings - Fork 365
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
feat(graph): allow sharing VCS branches through a lockfile #4899
Conversation
📊 Benchmark resultsComparing with b3dc897 Package size: 230 MB⬆️ 0.04% increase vs. b3dc897
Legend
|
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.
A few minor changes, but lgtm
* @param {NetlifyGraphLockfile.V0_format} input.lockfile | ||
*/ | ||
const writeLockfile = ({ lockfile, siteRoot }) => { | ||
writeFileSync(path.join(siteRoot, NetlifyGraphLockfile.defaultLockFileName), JSON.stringify(lockfile, null, 2)) |
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.
I suspect in the near future we may want a normalizeLockfile
function that inserts all the known keys in a deterministic order so that the JSON file is always written out in the same order as well, to prevent spurious changes in git
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.
I like that we enforce that invariant in the future. It should hopefully be the case right now if the entrypoint is always NetlifyGraphLockfile.createLockfile
src/lib/one-graph/cli-client.js
Outdated
*/ | ||
const handleOperationsLibraryPersistedEvent = async (input) => { | ||
const { schemaId, siteRoot } = input | ||
// await updateGraphQLOperationsFileFromPersistedDoc() |
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.
Delete?
|
||
const relevantHasLength = 10 | ||
writeGraphQLOperationsSourceFile({ logger, netlifyGraphConfig, operationsDocString }) | ||
regenerateFunctionsFileFromOperationsFile({ netlifyGraphConfig, schema }) |
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.
I think we'll need schemaId
here
*/ | ||
const maybeUpdateSessionFromLockfile = async (input) => { | ||
const { lockfile, netlifyToken, session } = input | ||
const sessionSchemaId = session.metadata && session.metadata.schemaId |
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 should update the underlying query to get session.graphQLSchema.id
when it's less painful to do so.
@@ -718,29 +820,80 @@ const generateSessionName = () => { | |||
return sessionName | |||
} | |||
|
|||
/** | |||
* Mark a session as inactive so it doesn't show up in any UI lists, and potentially becomes available to GC later |
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.
Is this doctoring correct? And the name would probably be better as idempotentlyUpdateSessionSchemaIdFromLockfile
🎉 Thanks for submitting a pull request! 🎉
Summary
Fixes #<replace_with_issue_number>
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)