Skip to content

Conversation

@Anmol1696
Copy link
Contributor

@Anmol1696 Anmol1696 commented Jan 16, 2026

Summary

Enable send-email-link function to work with jobs infrastructure via header-based GraphQL routing.

Changes

  • Fix schema field name mismatch in API middleware (schemaNamesFromExtapiExtensions)
  • Fix GraphQL response structure for apiByDatabaseIdAndName query
  • Add header-based routing support (X-Database-Id, X-Api-Name, etc.)
  • Strip subdomain for localhost domains (generates http://localhost:3000 not http://app.localhost:3000)
  • Add SMTP email support option
  • Update docker-compose with admin/public server split
  • Replace console.log with structured logger

Testing

  • Existing e2e tests pass
  • Added tests for forgot_password and email_verification email types
  • Manual docker-compose verification

Breaking Changes

  • simple-email function removed from docker-compose (use send-email-link instead)
  • Network renamed to constructive-tests-net
  • Admin server port changed to 3101

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the send-email-link Knative function to support header-based routing for GraphQL requests to an admin server with API_IS_PUBLIC=false. The changes enable multi-tenant GraphQL access using custom headers (X-Database-Id, X-Meta-Schema, X-Api-Name, X-Schemata) instead of relying on hostname-based routing.

Changes:

  • Enhanced createGraphQLClient function to support additional header-based routing options for internal admin server communication
  • Updated Docker Compose configuration to use the new admin server setup with API_IS_PUBLIC=false
  • Replaced outdated PostgreSQL image with newer version (ghcr.io/constructive-io/docker/postgres-plus:17)
  • Removed simple-email function references from documentation and Docker Compose in favor of send-email-link

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
jobs/README.md Updated documentation to reflect send-email-link function usage with admin server header-based routing, removed simple-email references
functions/send-email-link/src/index.ts Refactored createGraphQLClient to accept an options object with header-based routing parameters (databaseId, useMetaSchema, apiName, schemata)
docker-compose.yml Updated PostgreSQL image from pyramation/pgvector:13.3-alpine to ghcr.io/constructive-io/docker/postgres-plus:17
docker-compose.jobs.yml Renamed service from constructive-server to constructive-admin-server, added API_IS_PUBLIC=false, removed simple-email service references
Comments suppressed due to low confidence (1)

jobs/README.md:1

  • Corrected malformed heading. There's an extra 'n' character before the '#' symbol.
n# Jobs (Knative)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 9 comments.

Comments suppressed due to low confidence (1)

jobs/README.md:2

  • The line marker '----' (line 0 in diff) should be '---' (three hyphens) to match standard Markdown horizontal rule syntax used elsewhere in the document.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Anmol1696 Anmol1696 changed the title WIP: feature: update function to use admin server with headers feature: update function to use admin server with headers Jan 19, 2026
@Anmol1696 Anmol1696 marked this pull request as ready for review January 19, 2026 07:44
nodes: schemata.map((schemaName: string) => ({ schemaName })),
},
schemaNames: { nodes: [] as Array<{ schemaName: string }> },
schemasByApiSchemaApiIdAndSchemaId: { nodes: [] as Array<{ schemaName: string }> },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was potentially the bug that lead to API not found html error.

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