Skip to content

Sync main#2014

Merged
ygrishajev merged 17 commits intomain-sdk-nextfrom
sync-main
Oct 6, 2025
Merged

Sync main#2014
ygrishajev merged 17 commits intomain-sdk-nextfrom
sync-main

Conversation

@ygrishajev
Copy link
Contributor

@ygrishajev ygrishajev commented Oct 6, 2025

Summary by CodeRabbit

  • New Features

    • JWT-based managed wallet authentication across API, provider proxy, and clients.
    • Fallback APIs for deployment/lease listing and info when network is unavailable.
    • Payment polling to auto-refresh wallet balance after payments.
    • Unified Top Banner with maintenance/network-down notices; new Network Indicator.
    • Provider Console: dynamic, environment-driven network configuration.
    • Notifications: analytics integration (Amplitude) with sampling.
  • UX Improvements

    • Actions disabled during blockchain downtime (deploy, lease, certificates) with clearer messaging.
    • ARIA-disabled support on buttons/links for accessibility.
  • Changes

    • Removed payment discounts UI/queries; simplified PaymentForm.
    • Certificates optional on deployment update.
  • Chores

    • CI workflows expanded to main-sdk-next; Docker build flags for latest/force.

stalniy and others added 17 commits October 6, 2025 14:38
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat(provider): sandbox switching added to provider console

* feat(provider): fixed url and networkId selection

* fix(provider): deposit param query fix
)

* fix(billing): continue to fetch wallet for trial

* feat(deployment): add trial warning for non-anonymous
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* fix: proxy build script

* fix: typo
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* feat(analytics): add amplitude to notifications for emails

* fix(notifications): pr fixes

* fix: analytics tests

* fix: add test amplitude key

* fix(analytics): remove fail send amplitude

* fix(analytics): don't fail on analytics track

* fix: don't throw when undefined

* fix: logging
* feat(deployment): add lease list fallback

* fix(deployment): pr fixes

* fix(deployment): pr test fixes

* fix: update snapshot

* fix: tests

* fix: tests
* fix(billing): remove discounts calculations from ui

* fix(billing): remove discount calculations from api

* fix(billing): disable coupon button when loading

* fix(billing): pr fixes

* fix: remove unused function
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@ygrishajev ygrishajev requested a review from a team as a code owner October 6, 2025 12:39
@ygrishajev ygrishajev changed the base branch from main to main-sdk-next October 6, 2025 12:39
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

Expands CI triggers to include main-sdk-next; introduces reusable build/deploy inputs. Adds JWT-based managed-wallet auth with provider proxy updates, database-backed fallbacks for deployments/leases, and refactors wallet-scoped deployment flows. Removes Stripe discounts. Adds analytics sampling, payment polling, blockchain-down UI gating, and provider-console network config refactor. Includes indexer multi-version support and assorted SDK/package updates.

Changes

Cohort / File(s) Summary
CI triggers update
.github/workflows/*-build.yml, .github/workflows/*validate*.yml, .github/workflows/all-trigger-coverage.yml, .github/workflows/diff-package-lock.yml, .github/workflows/github-actions-lint.yml, .github/workflows/workspace-ci-unsafe.yml
Add pull_request triggers for main-sdk-next; no logic changes.
Reusable workflows enhancements
.github/workflows/reusable-build-image.yml, .github/workflows/reusable-deploy-k8s.yml
Build: add inputs tag-latest, force-build; pass through to script. Deploy: add testnet chain, force-rollout option, persist release_name, optional rollout restart.
Indexer release/testnet
.github/workflows/indexer-release-testnet.yml, .helm/indexer-staging-testnet-values.yaml
New workflow to build/deploy indexer to testnet; Helm adds chain=testnet and nodePort.
API changelog/deps/examples cleanup
apps/api/CHANGELOG.md, apps/api/package.json, apps/api/examples/*
New API release notes; add cockatiel, upgrade pg-boss; remove example SDL/env/lease-flow files.
Auth/API key schemas and routes
apps/api/src/auth/http-schemas/api-key.schema.ts, .../api-key.controller.ts, .../routes/api-keys/*.ts
Split visible/hidden API key responses; adjust controller return types and router OpenAPI registrations.
Auth service guard
apps/api/src/auth/services/auth.service.ts
Enforce currentUser presence with 401 assert.
Caching key change
apps/api/src/caching/helpers.ts, .../helpers.spec.ts
Cache key now includes numbers; tests updated accordingly.
Job queue context & retries
apps/api/src/core/services/job-queue/*
Inject ExecutionContextService; set user/ability per job; adjust retry/backoff; tests updated.
HTTP SDK DI refactor
apps/api/src/core/providers/http-sdk.provider.ts, packages/http-sdk/src/authz/authz-http.service.ts
Move AuthzHttpService to HttpClient-based non-axios services; add isReady getter; consumers updated.
Analytics sampling (API/Notifications)
apps/api/src/core/services/analytics/*, apps/notifications/src/modules/notifications/*
API: validate numeric sampling rate, typed event props. Notifications: add Amplitude, hash provider, AnalyticsService, track email events; env adds AMPLITUDE_*; tests added.
Provider JWT wiring
apps/api/src/provider/index.ts, .../providers/jwt.provider.ts, .../services/provider-jwt-token/*
Register JWT module in DI; add ProviderJwtTokenService to mint scoped JWTs; tests added.
Provider repository/service/proxy
apps/api/src/provider/repositories/provider/*, .../services/provider/provider.service.ts, .../provider-proxy.service.ts, packages/http-sdk/src/provider/provider-http.service.ts
Repository gains richer queries; ProviderService switches to repo + JWT auth; proxy now posts with generic auth (mtls/jwt), unified request; SDK adds JWT-based endpoints. Tests added.
Deployment/Lease wallet-scoped refactor
apps/api/src/deployment/controllers/*, .../services/deployment-*.ts, .../services/lease/lease.service.ts, .../http-schemas/*.ts
Controllers use auth.currentUser and userId; writer/reader resolve wallets internally; certificate fields optional; add fallback schemas and list/info endpoints.
DB fallback readers
apps/api/src/deployment/services/fallback-*-reader/*.ts, .../repositories/*
New services to read deployments/leases from DB with pagination; repositories add pagination methods; add routes/tests for fallback APIs; remove old db-deployment reader.
Stripe discounts removal
apps/api/src/billing/controllers/stripe/*, .../http-schemas/stripe.schema.ts, .../services/stripe/*, .../services/stripe-webhook/*, apps/deploy-web/src/pages/payment.tsx, .../components/user/payment/PaymentForm.tsx, .../queries/usePaymentQueries.*, .../queries/queryKeys.ts
Remove discounts schemas/endpoints/logic/tests; simplify payment flow; drop discounts UI and queries.
Wallet factory & reader init
apps/api/src/billing/lib/wallet/wallet.ts, .../providers/wallet.provider.ts, .../services/wallet-reader/wallet-reader.service.ts
Add wallet factory/token; expose wallet instance; reader overloads enforce initialized address.
Close trial deployment guard
apps/api/src/app/services/close-trial-deployment/*
Skip if wallet.address missing; pass enriched wallet to close; enqueue notification.
Deployment tests overhaul
apps/api/test/functional/*
Add managed API deployment flow; add fallback tests; remove legacy lease-flow E2E; update deployments spec for wallet-based flows.
Deploy-web blockchain-down gating
apps/deploy-web/src/components/* (Authorizations, CreateCertificateButton, CreateLease, ManifestEdit, Layout, Sidebar, TopBanner, DeploymentList, YourAccount, SettingsContainer)
Use settings.isBlockchainDown to disable actions and show banners; introduce TopBannerProvider and unified TopBanner; tests updated.
Deploy-web payment polling
apps/deploy-web/src/context/PaymentPollingProvider/*, .../pages/_app.tsx, .../pages/payment.tsx, tests
New provider/hook to poll balances after payments; integrated into app and payment page; tests added.
Deploy-web services/hooks
apps/deploy-web/src/context/ServicesProvider/*, .../hooks/useManagedWallet.ts, .../queries/*
AuthzHttpService DI via HttpClient; expose isFetching; queries gated by isReady and blockchain health; managed wallet key helper.
Auth0 redirect util
apps/deploy-web/src/services/auth/auth/rewrite-local-redirect.ts, .../pages/api/auth/*
Factor redirect rewriting into shared util; apply in login/signup handlers.
Provider-console network refactor
apps/provider-console/env/*.env*, .../config/*, .../context/*, .../store/networkStore.ts, .../utils/*, .../components/layout/*
Replace legacy env with unified NEXT_PUBLIC_*; dynamic chain/network config; update clients/endpoints; add NetworkIndicator UI.
Provider-proxy certs endpoint/timeout
apps/provider-proxy/src/services/ProviderService/*, .../test/setup/chainApiServer.ts, package.json, tsconfig.build.json
Switch certs list to v1 endpoint; add fetch timeout; retry condition >=500; adjust build options; tests updated.
Indexer updates
apps/indexer/*
Add chain-sdk dep, version bump; support Akash v1/v1beta4/v1beta5 messages; adjust protobuf registry; stop base64-decoding tx attrs; minor validator normalization; tsconfig tweaks.
Packages misc
packages/docker/*, packages/logging/src/*, packages/net/scripts/generate.ts, packages/database/*, packages/jwt/src/wallet-utils.ts, packages/http-sdk/src/*
Docker build: mark-latest flag; base images roll back; fix logging export path; net generation networks; testnet RPC via @akashnetwork/net; JWT wallet sign API changes; SDK: export types, pagination fields, lease next_key nullable.
Changelogs and versions
apps/*/CHANGELOG.md, apps/*/package.json
Bump versions and add release notes across API, indexer, log-collector, notifications, stats-web, provider-console.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant API as API (Console)
  participant Repo as ProviderRepository
  participant JWT as ProviderJwtTokenService
  participant Proxy as ProviderProxyService
  participant Prov as Provider

  User->>API: Create lease / Get lease status
  API->>Repo: find provider by address
  Repo-->>API: Provider + identity
  alt Auth via mTLS
    API->>Proxy: request(url, {auth: mtls})
  else Auth via Managed Wallet JWT
    API->>JWT: generateJwtToken(walletId, leases)
    JWT-->>API: JWT token
    API->>Proxy: request(url, {auth: jwt})
  end
  Proxy->>Prov: POST via provider-proxy URL
  Prov-->>Proxy: Response
  Proxy-->>API: Data
  API-->>User: Result
Loading
sequenceDiagram
  autonumber
  actor Client
  participant API as API
  participant Chain as Chain RPC/REST
  participant DB as DB Fallback
  note over API: List/Info with network fallback
  Client->>API: GET deployments/leases (fallback endpoints)
  API->>Chain: Try RPC/REST
  alt Network error/timeout/5xx
    API->>DB: Query repositories with pagination
    DB-->>API: Rows + count
  else Success
    Chain-->>API: Data
  end
  API-->>Client: Normalized response (with pagination)
Loading
sequenceDiagram
  autonumber
  actor User
  participant Web as deploy-web
  participant Pay as Stripe
  participant API as Console API

  User->>Web: Submit payment / apply coupon
  Web->>Pay: Create/confirm PaymentIntent
  Pay-->>API: Webhook (amount_received)
  API->>API: Top up wallet
  Web->>Web: PaymentPollingProvider.start()
  loop until balance increases or timeout
    Web->>API: GET wallet balance
    API-->>Web: Balance
  end
  Web-->>User: Success snackbar and updated balance
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~150 minutes

Possibly related PRs

Suggested reviewers

  • baktun14
  • stalniy

Poem

A rabbit taps the merge, with twitchy cheer,
JWTs in paws, the network’s crystal-clear.
When chains go down, we hop to DB lanes,
Poll payments fast, then rest our claims.
New banners wave, the rockets zoom—
Ship it, ship it—thump-thump, boom! 🐇🚀

Pre-merge checks and finishing touches and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 29.33% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The title “Sync main” is too generic and does not convey the primary work in this changeset, which involves updating CI workflows to support both main and main-sdk-next branches, adding a new indexer-release-testnet workflow, and numerous feature updates across multiple services and UIs. It fails to inform reviewers of the core scope and intent of the pull request. Please rename the pull request to clearly summarize the key changes, for example: “Update CI workflows for main-sdk-next branch and add indexer-release-testnet workflow.”
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync-main
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sync-main

Comment @coderabbitai help to get the list of available commands and usage tips.

@@ -35,14 +35,15 @@
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🔄 Carefully review the package-lock.json diff

Resolve the comment if everything is ok

* node_modules/call-bind                                                                   1.0.7 -> 1.0.8
* node_modules/json-stable-stringify                                                       1.1.1 -> 1.3.0
* node_modules/long                                                                        5.3.1 -> 5.3.2
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/crypto                         0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/encoding                       0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/json-rpc                       0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/math                           0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/proto-signing                  0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/socket                         0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/stargate/node_modules/@cosmjs/amino 0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/stargate                       0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/stream                         0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/tendermint-rpc                 0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/@cosmjs/utils                          0.33.1  
+ node_modules/@akashnetwork/chain-sdk/node_modules/ws                                     7.5.10  
+ node_modules/@akashnetwork/chain-sdk                                                     1.0.0-alpha.3
+ node_modules/@bufbuild/protobuf                                                          2.9.0   
+ node_modules/@connectrpc/connect-node                                                    2.1.0   
+ node_modules/@connectrpc/connect                                                         2.1.0   

@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​akashnetwork/​chain-sdk@​1.0.0-alpha.37710010093100

View full report

@ygrishajev ygrishajev enabled auto-merge (rebase) October 6, 2025 12:45
@ygrishajev ygrishajev disabled auto-merge October 6, 2025 12:45
@ygrishajev ygrishajev merged commit 667a415 into main-sdk-next Oct 6, 2025
51 of 64 checks passed
@ygrishajev ygrishajev deleted the sync-main branch October 6, 2025 12:46
@coderabbitai coderabbitai bot mentioned this pull request Oct 13, 2025
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.

5 participants

Comments