-
Notifications
You must be signed in to change notification settings - Fork 16
feat(docs): OpenAPI spec sync with CI validation and PR previews #1550
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
Changes from all commits
237de51
9045cc6
cc5f236
ddc8bf6
9da0a88
3ae1447
61b4438
06c49c5
66e4b1e
30dff75
67ff063
c75e78f
aaf1a73
80f06e0
630309f
ab5927b
fa0119d
bdca6ea
fac4754
1973ef6
911bc3c
f1dd11d
b1cea1a
323e565
98bece8
f493d51
3945545
a16f9eb
7ad6563
91dfe3c
600294a
21b72af
bba27af
692a119
b640ca9
16a641f
87c5180
ac91cff
4e11eb8
8ac20f5
83ae0ba
f7d7031
0d1d1d5
367c991
ffb49ae
1a94122
5d7e8ee
e59fb6f
4037d9f
9d1bf2a
5cade8d
5965d3f
f287094
42a19d0
731b4fe
690b155
09bf81d
546d0f4
e82231a
a5ed508
ab00660
57261ce
6bd4d09
419468c
e14ef97
32ea6a4
76cab69
3d37753
41c95b2
c69b37a
cf0fc54
5d563ea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@docs/mintlify": patch | ||
| --- | ||
|
|
||
| Introduce API documentation for ENSApi that's generated automatically from the OpenAPI spec |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "ensapi": patch | ||
| --- | ||
|
|
||
| Add `OPENAPI_GENERATE_MODE` environment variable to enable starting ENSApi with a mock config exclusively for OpenAPI spec generation without external dependencies |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,122 @@ | ||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Generate OpenAPI spec from ENSApi | ||||||||||||||||||||||||||||||||||||||||
| # This script can be used both locally and in CI | ||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||
| # Usage: | ||||||||||||||||||||||||||||||||||||||||
| # ./generate_openapi_spec.sh # Generate spec (default) | ||||||||||||||||||||||||||||||||||||||||
| # ./generate_openapi_spec.sh --check # Generate and verify against committed version | ||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||
| # Environment variables: | ||||||||||||||||||||||||||||||||||||||||
| # ENSAPI_PORT - Port for ENSApi (default: 4334) | ||||||||||||||||||||||||||||||||||||||||
| # STARTUP_TIMEOUT - Seconds to wait for server startup (default: 30) | ||||||||||||||||||||||||||||||||||||||||
| # SKIP_VALIDATION - Set to "true" to skip Mintlify validation (default: false) | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Configuration | ||||||||||||||||||||||||||||||||||||||||
| ENSAPI_PORT="${ENSAPI_PORT:-4334}" | ||||||||||||||||||||||||||||||||||||||||
| STARTUP_TIMEOUT="${STARTUP_TIMEOUT:-30}" | ||||||||||||||||||||||||||||||||||||||||
| SKIP_VALIDATION="${SKIP_VALIDATION:-false}" | ||||||||||||||||||||||||||||||||||||||||
| ENSAPI_URL="http://localhost:${ENSAPI_PORT}" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Parse arguments | ||||||||||||||||||||||||||||||||||||||||
| CHECK_MODE=false | ||||||||||||||||||||||||||||||||||||||||
| for arg in "$@"; do | ||||||||||||||||||||||||||||||||||||||||
| case $arg in | ||||||||||||||||||||||||||||||||||||||||
| --check) | ||||||||||||||||||||||||||||||||||||||||
| CHECK_MODE=true | ||||||||||||||||||||||||||||||||||||||||
| shift | ||||||||||||||||||||||||||||||||||||||||
| ;; | ||||||||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+23
to
+32
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial
The Proposed cleanup # Parse arguments
CHECK_MODE=false
for arg in "$@"; do
case $arg in
--check)
CHECK_MODE=true
- shift
;;
esac
done📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Detect repository root | ||||||||||||||||||||||||||||||||||||||||
| if [ -n "$GITHUB_WORKSPACE" ]; then | ||||||||||||||||||||||||||||||||||||||||
| REPO_ROOT="$GITHUB_WORKSPACE" | ||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||
| SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||||||||||||||||||||||||||||||||||||||||
| REPO_ROOT="$( cd "$SCRIPT_DIR/../.." && pwd )" | ||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| OPENAPI_JSON="$REPO_ROOT/docs/docs.ensnode.io/openapi.json" | ||||||||||||||||||||||||||||||||||||||||
| ENSAPI_PID="" | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Cleanup function | ||||||||||||||||||||||||||||||||||||||||
| cleanup() { | ||||||||||||||||||||||||||||||||||||||||
| if [ -n "$ENSAPI_PID" ]; then | ||||||||||||||||||||||||||||||||||||||||
| echo "Stopping ENSApi (PID: $ENSAPI_PID)..." | ||||||||||||||||||||||||||||||||||||||||
| kill "$ENSAPI_PID" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||
| wait "$ENSAPI_PID" 2>/dev/null || true | ||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| trap cleanup EXIT INT TERM | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| echo "Starting ENSApi in OpenAPI generate mode..." | ||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||
| # Start ENSApi in background | ||||||||||||||||||||||||||||||||||||||||
| cd "$REPO_ROOT" | ||||||||||||||||||||||||||||||||||||||||
| OPENAPI_GENERATE_MODE=true pnpm --filter ensapi start & | ||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||
| OPENAPI_GENERATE_MODE=true pnpm --filter ensapi start & | |
| PORT="$ENSAPI_PORT" OPENAPI_GENERATE_MODE=true pnpm --filter ensapi start & |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,6 +94,111 @@ jobs: | |
| chmod +x ./.github/scripts/promote_ensadmin.sh | ||
| ./.github/scripts/promote_ensadmin.sh | ||
|
|
||
| - name: Trigger Mintlify Docs Rebuild | ||
| id: mintlify_rebuild | ||
| # Non-blocking: failures are reported to Slack and can be manually retriggered | ||
| continue-on-error: true | ||
| env: | ||
| MINTLIFY_API_TOKEN: ${{ secrets.MINTLIFY_API_TOKEN }} | ||
| MINTLIFY_PROJECT_ID: ${{ vars.MINTLIFY_PROJECT_ID }} | ||
| run: | | ||
| # Trigger the rebuild and capture the statusId | ||
| HTTP_RESPONSE=$(curl --silent --write-out "\n%{http_code}" \ | ||
| --connect-timeout 10 \ | ||
| --max-time 30 \ | ||
| --retry 2 \ | ||
| --retry-delay 5 \ | ||
| --request POST \ | ||
| --url "https://api.mintlify.com/v1/project/update/${MINTLIFY_PROJECT_ID}" \ | ||
| --header "Authorization: Bearer ${MINTLIFY_API_TOKEN}") | ||
|
|
||
| HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed '$d') | ||
| HTTP_CODE=$(echo "$HTTP_RESPONSE" | tail -n1) | ||
|
notrab marked this conversation as resolved.
|
||
|
|
||
| if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then | ||
| echo "Mintlify API returned HTTP $HTTP_CODE" | ||
| echo "Response body: $HTTP_BODY" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Mintlify rebuild triggered successfully (HTTP $HTTP_CODE)" | ||
|
|
||
| # Extract statusId from response | ||
| STATUS_ID=$(echo "$HTTP_BODY" | jq -r '.statusId // empty') | ||
| if [ -z "$STATUS_ID" ]; then | ||
| echo "Failed to extract statusId from response" | ||
| echo "Response body: $HTTP_BODY" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Status ID: $STATUS_ID" | ||
|
|
||
| # Poll for completion (max 5 minutes, checking every 10 seconds) | ||
| MAX_ATTEMPTS=30 | ||
| ATTEMPT=0 | ||
|
|
||
| while [ $ATTEMPT -lt $MAX_ATTEMPTS ]; do | ||
| ATTEMPT=$((ATTEMPT + 1)) | ||
| echo "Checking status (attempt $ATTEMPT/$MAX_ATTEMPTS)..." | ||
|
|
||
| STATUS_RESPONSE=$(curl --silent --write-out "\n%{http_code}" \ | ||
| --connect-timeout 10 \ | ||
| --max-time 30 \ | ||
| --request GET \ | ||
| --url "https://api.mintlify.com/v1/project/update-status/${STATUS_ID}" \ | ||
| --header "Authorization: Bearer ${MINTLIFY_API_TOKEN}") | ||
|
|
||
| STATUS_BODY=$(echo "$STATUS_RESPONSE" | sed '$d') | ||
| STATUS_CODE=$(echo "$STATUS_RESPONSE" | tail -n1) | ||
|
|
||
| if [ "$STATUS_CODE" -lt 200 ] || [ "$STATUS_CODE" -ge 300 ]; then | ||
| echo "Status check failed with HTTP $STATUS_CODE" | ||
| echo "Response: $STATUS_BODY" | ||
| sleep 10 | ||
| continue | ||
| fi | ||
|
|
||
| STATUS=$(echo "$STATUS_BODY" | jq -r '.status // empty') | ||
| echo "Current status: $STATUS" | ||
|
|
||
| case "$STATUS" in | ||
| "success") | ||
| echo "Mintlify docs rebuild completed successfully" | ||
| exit 0 | ||
| ;; | ||
| "failure") | ||
| echo "Mintlify docs rebuild failed" | ||
| exit 1 | ||
| ;; | ||
| "queued"|"in_progress") | ||
| sleep 10 | ||
| ;; | ||
| *) | ||
| echo "Unknown status: $STATUS" | ||
| sleep 10 | ||
| ;; | ||
| esac | ||
| done | ||
|
|
||
| echo "Timeout waiting for Mintlify rebuild to complete" | ||
| exit 1 | ||
|
|
||
| - name: Notify Mintlify Rebuild Failure | ||
| if: steps.mintlify_rebuild.outcome == 'failure' | ||
| uses: ./.github/actions/send_slack_notification | ||
| with: | ||
| slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| slack_title: "Mintlify Docs Rebuild Failed" | ||
| slack_message: "Mintlify docs rebuild failed during environment switch to ${{ inputs.target }}. Check the workflow logs for details." | ||
|
|
||
| - name: Notify Mintlify Rebuild Success | ||
| if: steps.mintlify_rebuild.outcome == 'success' | ||
| uses: ./.github/actions/send_slack_notification | ||
| with: | ||
| slack_webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| slack_title: "Mintlify Docs Rebuilt" | ||
| slack_message: "Mintlify docs successfully rebuilt for environment switch to ${{ inputs.target }}. API Reference built from: https://api.alpha.ensnode.io/openapi.json" | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @notrab I'd also like to see an additional separate Slack notification sent to notify us of successfully rebuilt Mintlify docs. This notification ideally should also include a reference to the specific URL to the OpenAPI.json that the new production Mintlify API docs were successfully built from. Goal: Help everyone in our team build a stronger mental model for how all these pieces are working together.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've updated the message to include the URL to the OpenAPI spec Trafik handles the routing so this URL should always be the prod one. |
||
| - name: Send Slack Notification | ||
| uses: ./.github/actions/send_slack_notification | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,3 +119,24 @@ DATABASE_URL=postgresql://dbuser:abcd1234@localhost:5432/my_database | |
| # Note: ENS_HOLIDAY_AWARDS_START date must be before or the same as ENS_HOLIDAY_AWARDS_END | ||
| # ENS_HOLIDAY_AWARDS_START="2025-12-01T00:00:00Z" | ||
| # ENS_HOLIDAY_AWARDS_END="2025-12-31T23:59:59Z" | ||
|
|
||
| # OpenAPI Generate Mode | ||
| # Optional. When set to "true", ENSApi starts with a minimal mock configuration, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Feedback:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lightwalker-eth great idea about the middleware. Makes things a bit simpler and more isolated, thanks! |
||
| # bypassing the need for a real database, ENSIndexer, or RPC connections. | ||
| # This is useful for generating the OpenAPI spec without external dependencies. | ||
| # | ||
| # When enabled: | ||
| # - All routes return HTTP 503 Service Unavailable EXCEPT for /openapi.json | ||
| # - The following environment variables are IGNORED (mock values are used instead): | ||
| # - DATABASE_URL | ||
| # - ENSINDEXER_URL | ||
| # - THEGRAPH_API_KEY | ||
| # - All RPC configuration variables (ALCHEMY_API_KEY, QUICKNODE_API_KEY, | ||
| # QUICKNODE_ENDPOINT_NAME, DRPC_API_KEY, RPC_URL_*) | ||
| # - ENS_HOLIDAY_AWARDS_START | ||
| # - ENS_HOLIDAY_AWARDS_END | ||
| # - The following environment variables are still respected: | ||
| # - PORT | ||
| # - LOG_LEVEL | ||
| # | ||
| # OPENAPI_GENERATE_MODE=true | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -21,6 +21,8 @@ import logger from "@/lib/logger"; | |||||||||||||||||||||||||||||||||||||||||||||
| vi.mock("@/lib/logger", () => ({ | ||||||||||||||||||||||||||||||||||||||||||||||
| default: { | ||||||||||||||||||||||||||||||||||||||||||||||
| error: vi.fn(), | ||||||||||||||||||||||||||||||||||||||||||||||
| info: vi.fn(), | ||||||||||||||||||||||||||||||||||||||||||||||
| warn: vi.fn(), | ||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -58,6 +60,28 @@ describe("buildConfigFromEnvironment", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| mockFetch.mockReset(); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| it("returns mock config without fetching when OPENAPI_GENERATE_MODE is enabled", async () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| const result = await buildConfigFromEnvironment({ | ||||||||||||||||||||||||||||||||||||||||||||||
| OPENAPI_GENERATE_MODE: "true", | ||||||||||||||||||||||||||||||||||||||||||||||
| PORT: "5000", | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| expect(mockFetch).not.toHaveBeenCalled(); | ||||||||||||||||||||||||||||||||||||||||||||||
| expect(result.port).toBe(5000); | ||||||||||||||||||||||||||||||||||||||||||||||
| expect(result.namespace).toBe("mainnet"); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| it("logs warning when OPENAPI_GENERATE_MODE has invalid value", async () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| mockFetch.mockResolvedValueOnce({ | ||||||||||||||||||||||||||||||||||||||||||||||
| ok: true, | ||||||||||||||||||||||||||||||||||||||||||||||
| json: () => Promise.resolve(serializeENSIndexerPublicConfig(ENSINDEXER_PUBLIC_CONFIG)), | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| await buildConfigFromEnvironment({ ...BASE_ENV, OPENAPI_GENERATE_MODE: "false" }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| expect(logger.warn).toHaveBeenCalled(); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+74
to
+83
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Consider asserting the warning message content. The test confirms Suggested improvement- expect(logger.warn).toHaveBeenCalled();
+ expect(logger.warn).toHaveBeenCalledWith(
+ expect.stringContaining("OPENAPI_GENERATE_MODE is set to 'false'"),
+ );📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| it("returns a valid config object using environment variables", async () => { | ||||||||||||||||||||||||||||||||||||||||||||||
| mockFetch.mockResolvedValueOnce({ | ||||||||||||||||||||||||||||||||||||||||||||||
| ok: true, | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -84,6 +108,7 @@ describe("buildConfigFromEnvironment", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| ]), | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsStart: ENS_HOLIDAY_AWARDS_START_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsEnd: ENS_HOLIDAY_AWARDS_END_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| inOpenApiGenerateMode: false, | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -166,6 +191,7 @@ describe("buildEnsApiPublicConfig", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| ]), | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsStart: ENS_HOLIDAY_AWARDS_START_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsEnd: ENS_HOLIDAY_AWARDS_END_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| inOpenApiGenerateMode: false, | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const result = buildEnsApiPublicConfig(mockConfig); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -191,6 +217,7 @@ describe("buildEnsApiPublicConfig", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| rpcConfigs: new Map(), | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsStart: ENS_HOLIDAY_AWARDS_START_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsEnd: ENS_HOLIDAY_AWARDS_END_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| inOpenApiGenerateMode: false, | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const result = buildEnsApiPublicConfig(mockConfig); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -227,6 +254,7 @@ describe("buildEnsApiPublicConfig", () => { | |||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsStart: ENS_HOLIDAY_AWARDS_START_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| ensHolidayAwardsEnd: ENS_HOLIDAY_AWARDS_END_DATE, | ||||||||||||||||||||||||||||||||||||||||||||||
| theGraphApiKey: "secret-api-key", | ||||||||||||||||||||||||||||||||||||||||||||||
| inOpenApiGenerateMode: false, | ||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| const result = buildEnsApiPublicConfig(mockConfig); | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
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.
🧹 Nitpick | 🔵 Trivial
Add
set -o pipefailfor safer pipe error handling.With
set -ebut nopipefail, failures in the left-hand side of pipes (e.g., ifcurlfails but output is piped throughsed/taillater in other scripts) can be silently swallowed. Since this script usesset -e, addingpipefailensures consistent fail-fast behavior.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents