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

Subgraph V1.7.0 Release #1820

Merged
merged 6 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2945,12 +2945,19 @@ type SFMeta @entity {
id: ID!
timestamp: BigInt!
blockNumber: BigInt!

"""
Whether the branch is feature/dev/v1.
"""
configuration: String!

"""
The branch the current deployment is coming from.
"""
branch: String!

"""
The subgraph package.json semver version of the current deployment.
"""
packageVersion: String!
}
3 changes: 2 additions & 1 deletion packages/subgraph/src/mappings/host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
SuperTokenLogicUpdated,
} from "../../generated/Host/ISuperfluid";
import { createEventID, initializeEventEntity } from "../utils";
import { commitHash, configuration, branch } from "../meta.ignore";
import { commitHash, configuration, branch, packageVersion } from "../meta.ignore";
import { ethereum } from "@graphprotocol/graph-ts";
import { SuperfluidGovernance } from "../../generated/templates";

Expand Down Expand Up @@ -113,6 +113,7 @@ function initSFMetaOnce(event: ethereum.Event): void {
sfMeta.blockNumber = event.block.number;
sfMeta.configuration = configuration;
sfMeta.branch = branch;
sfMeta.packageVersion = packageVersion;
sfMeta.save();
}
}
4 changes: 4 additions & 0 deletions packages/subgraph/tasks/getSFMeta.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# This files is a bash script that is used to generate the src/meta.ignore.ts file.
# This is used to fill out the SFMeta entity (see schema.graphql)
# The different fields: `${SOME_FIELD}` must be set in the enivronment when running this script.
#!/usr/bin/env bash
BRANCH="$(git branch --show-current)"

cat > src/meta.ignore.ts << EOF
export let commitHash = "${COMMIT_HASH}";
export let configuration = "${CONFIGURATION}";
export let branch = "${BRANCH}";
export let packageVersion = "${PACKAGE_VERSION}";
hellwolf marked this conversation as resolved.
Show resolved Hide resolved
EOF
Loading