Skip to content

chore: Update tinygraphs url#296

Draft
brunomenezes wants to merge 2 commits into
mainfrom
chore/update-tinygraphs-url
Draft

chore: Update tinygraphs url#296
brunomenezes wants to merge 2 commits into
mainfrom
chore/update-tinygraphs-url

Conversation

@brunomenezes

@brunomenezes brunomenezes commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Refactors the tinygraphs service URL resolution from a hardcoded string literal to a dynamic, environment-backed configuration fallback.

Why

For context: We are revisiting our infrastructure and, as part of moving services from one place to another (Tinygraph is one of them), much-needed changes are underway.
The tinygraphs base URL was previously hardcoded, restricting environment-specific customization. This change decouples the infrastructure dependency from the codebase, allowing seamless flexibility across local, staging, and production environments without code modifications.

What Changed

  • Configuration: Exposed NEXT_PUBLIC_TINYGRAPHS_URL as a public environment variable. Updated .env.development and production environment templates.
  • Architecture: Introduced a centralized utility helper to handle URL resolution logic (process.env.NEXT_PUBLIC_TINYGRAPHS_URL || DEFAULT_CARTESI_ENDPOINT).
  • Performance/HTML: Updated <link rel="preconnect"> tags to dynamically inject the resolved URL, preserving optimization and prefetching benefits for custom endpoints.
  • Test Suite: Updated unit tests to validate both the fallback logic and explicit override states.

Behavior

  • [No Env Var] ---------> Resolves to: Cartesi Default URL
  • [Env Var Present] ----> Resolves to: NEXT_PUBLIC_TINYGRAPHS_URL

Backward Compatibility

  • Fully backward compatible: The fallback mechanism ensures zero disruption to existing environments or unconfigured deployments.

Notes

This change reduces hardcoded infrastructure assumptions.

@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
staking Ready Ready Preview, Comment Jun 22, 2026 2:28pm

Request Review

@coveralls

coveralls commented Jun 22, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27959693301

Coverage increased (+0.03%) to 66.43%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 4 of 4 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 3800
Covered Lines: 2648
Line Coverage: 69.68%
Relevant Branches: 1982
Covered Branches: 1193
Branch Coverage: 60.19%
Branches in Coverage %: Yes
Coverage Strength: 29.84 hits per line

💛 - Coveralls

* In case of missing environment variable it will use a default provided by Cartesi.
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