Page MenuHomeElementl

[dagster-graphql] Dagster GraphQL Python Client [2/4]
ClosedPublic

Authored by sidkmenon on Apr 14 2021, 6:18 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jun 2, 7:28 AM
Unknown Object (File)
Tue, May 23, 1:03 AM
Unknown Object (File)
Wed, May 17, 10:15 AM
Unknown Object (File)
Tue, May 16, 3:28 PM
Unknown Object (File)
Tue, May 16, 12:05 AM
Unknown Object (File)
Sat, May 13, 11:25 PM
Unknown Object (File)
Fri, May 12, 12:17 AM
Unknown Object (File)
Wed, May 10, 1:26 PM
Subscribers
None

Details

Summary

This diff creates the dagster-graphql-client CLI:

  1. Adds BK checks to ensure that current GraphQL queries by the client are included in a legacy query query_snapshot folder via dagster-graphql-client query check a. It also adds the dagster-graphql-client query snapshot command to add the GraphQL client's queries to the query_snapshot directory
  2. Tests to ensure that each query in the client_backcompat directory is still supported by the GraphQL server (so at a minimum, we can be intentional about breaking changes that arise)

Depends on D7409

Test Plan

bk script checks + new backcompat tests (this diff is mostly tests)

Diff Detail

Repository
R1 dagster
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sidkmenon held this revision as a draft.

Fixing build errors (typo in the pip install directives on helm)

sidkmenon retitled this revision from dagster-graphql] Dagster GraphQL Python Client [2/3] to [dagster-graphql] Dagster GraphQL Python Client [2/3].

This script looks better placed in python_modules/automation since it's generating some persisted artifacts (the query snapshots) - it should probably be invoked as dagster-graphql-client.

Might make sense to split the logic you have in check_python_client_queries_in_backcompat_directory. It's pretty hard to grok what's happening. There's two things you are doing:

  1. Checking if all queries are present
  2. Rehydrating the queries

1 and 2 should be separate methods (i.e. separate click commands), instead of gating by boolean. Just seems cleaner to separate these ideas.

Then, we can just invoke them separately. The bk check would do something like dagster-graphql-client query check and if that fails, then the user should dagster-graphql-client query snapshot to rehydrate the
client_backcompat/ queries

python_modules/dagster-graphql/dagster_graphql_tests/graphql/client_backcompat/queries/RELOAD_REPOSITORY_LOCATION_MUTATION/0.11.4-2021_04_14.graphql
1 ↗(On Diff #35372)

unnecessary new line?

scripts/check_python_client_queries.py
45 ↗(On Diff #35372)
This revision now requires changes to proceed.Apr 14 2021, 8:43 PM
sidkmenon marked an inline comment as done.

Responding to comments - refactoring cli to dagster-graphql-client cli

Adding checks for redundant dagster-graphql-client query snapshot calls and refactoring

Added regex check to remove redundant spacing from query strings as well

Adding dagster-graphql to tox.ini and setup.py in automation

Trying installation of dagster-graphql to fix build

Adding README.md for the dagster-graphql-client CLI

sidkmenon retitled this revision from [dagster-graphql] Dagster GraphQL Python Client [2/3] to [dagster-graphql] Dagster GraphQL Python Client [2/4].Apr 19 2021, 5:18 PM
sidkmenon edited the summary of this revision. (Show Details)
rexledesma added inline comments.
.buildkite/dagster-buildkite/dagster_buildkite/steps/dagster.py
536–539

nit: these can be separate lines

This revision is now accepted and ready to land.Apr 19 2021, 5:28 PM
sidkmenon marked an inline comment as done.

nit fixes