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

[WORKFLOW] SDK-Core/Subgraph CI Cleanup Fixes #1303

Merged
merged 10 commits into from
Mar 7, 2023

Conversation

0xdavinchee
Copy link
Contributor

@0xdavinchee 0xdavinchee commented Mar 6, 2023

Summary

Currently, we have a bunch of workflow files/tests which were added as defense for publishing an SDK-Core version which is incompatible with the deployed subgraph.

Only acceptable reason for breaking

The only time a breaking change should occur is when the query in SDK-Core contains properties which don't exist in the deployed subgraph.

That is, we never want to push a change to the subgraph which breaks previous SDK-Core versions via modifying entities, etc.

Proposed Solution

untitled@2x

The workflow files added previously have unintended consequences which seem to impact unrelated PRs. Feature and dev builds where no subgraph/SDK-core changes have been made should not break because the deployed subgraph for feature/dev/v1 are out of sync for that particular branch.

As a result, what we truly care about is:

whenever we want to publish a new SDK-Core release, it should not break.

See above for the only reason it should be breaking.

We should only run these tests prior to a publish of SDK-Core or a deployment of a subgraph.

Changes

package.json

  • remove sdk-core from root package.json tests

ci.feature

  • remove eager testing in ci.feature

ci.canary

  • remove eager testing in ci.canary
  • call.setup-deploy-and-test-local-subgraph.yml only tests local subgraphs, even schema generation
  • consolidate runQueryTests.ts and queryTests.ts

call.test-local-subgraph

  • remove sdk-core integration tests

call.deploy-subgraph

  • run tests prior to deploying subgraph to ensure compatibility

call.test-sdk-core

  • always have local subgraph to test against

cd.sdk-core-stable.create-release-draft

  • only create release draft if tests pass

## package.json
- remove sdk-core from root package.json tests

## ci.feature
- remove eager testing in ci.feature

## ci.canary
- remove eager testing in ci.canary
- call.setup-deploy-and-test-local-subgraph.yml only tests local subgraphs, even schema generation
- consolidate `runQueryTests.ts` and `queryTests.ts`
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

- run checks prior to deploying subgraph:
  - ensure desired subgraph works w/ previous versions
  - ensure subgraph mapping logic is intact and queries can be called on local subgraph

- run checks prior to creating sdk-core release draft
  - test sdk-core schema is consistent with deployed v1
  - run sdk-core unit tests

- rename `call.setup-deploy-and-test-local-subgraph.yml` to `call.test-local-subgraph.yml`

- remove SDK-Core integration tests in call.test-local-subgraph

- cleanup ci.canary given changes

- cleanup ci.feature given changes

- delete ci.pre-release-sdk-core/subgraph
@0xdavinchee 0xdavinchee marked this pull request as ready for review March 6, 2023 15:40
@0xdavinchee 0xdavinchee requested review from kasparkallas, hellwolf and a team as code owners March 6, 2023 15:40
@hellwolf
Copy link
Contributor

hellwolf commented Mar 6, 2023

image
How many "previous versions" we are talking about here?

@0xdavinchee
Copy link
Contributor Author

image
How many "previous versions" we are talking about here?

https://github.com/superfluid-finance/protocol-monorepo/blob/dev/.github/workflows/call.test-subgraph-on-previous-sdk-core-versions.yml#L21

Looks like this file is out of date though, but since 0.3.2.

echo github.head_ref: ${{ github.head_ref }}
echo github.base_ref: ${{ github.base_ref }}

build-and-test-local-subgraph:
Copy link
Contributor

Choose a reason for hiding this comment

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

I appreciate the meticulousness, but repeating "key" and "name" with the same information is not necessarily adding anything but noise. I think it's worth to be conscious of not adding syntactic noise too casually.

Copy link
Contributor

Choose a reason for hiding this comment

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

"build-and-test-local-subgraph:" is almost conflict with "name: Build and Test Subgraph (Release Branch)" on the surface, so not sure.

const {deployContractsAndToken} = require("./deploy-contracts-and-token");

deployContractsAndToken()
.then(async (deployer) => {
.then(async ({deployer, tokenDeploymentOutput}) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

okay.

Copy link
Contributor

@hellwolf hellwolf 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 cleanup. I haven't necessarily reviewed in great details, but do not want to block it neither.

@0xdavinchee 0xdavinchee merged commit 27f5cc2 into dev Mar 7, 2023
@0xdavinchee 0xdavinchee deleted the subgraph-sdk-core-workflow-cleanup branch March 7, 2023 08:09
@github-actions
Copy link

github-actions bot commented Mar 7, 2023

XKCD Comic Relif

Link: https://xkcd.com/1303
https://xkcd.com/1303

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.

2 participants