Skip to content

Conversation

@Jovonni
Copy link
Contributor

@Jovonni Jovonni commented Jan 6, 2026

draft on two new functions, for hello-world and runtime-script, and now each function has tests in it that use pgsql-test. We are now connecting to a db locally (within the container) (each function has its own emphemeral db), and also connecting over the name service to connect to our internal db. I want to do some more sanity checks but heres a solid draft @Anmol1696 . will also look at merge conflicts

and we were able to use kubernetesjs, even though we can do some consolidation of utils like constructive/functions/*/__tests__/k8s-utils.ts, and maybe put it into kubernetes-test

contributions

dependencies & configuration:

  • resolved merge conflict in pnpm-lock.yaml
  • updated pnpm-lock.yaml to match current package.json states across all 73 workspace projects
  • auto-merged package.json updates in graphql/react and graphql/server

graphql/codegen (major overhaul):

  • added extensive new structure for codegen cli and core logic
  • introduced new modules: cli/codegen, cli/introspect, cli/watch, core/meta-object, generators
  • added support for orm generation (model-generator, query-builder)
  • added reacting bindings
  • removed old single-file implementations (codegen.ts, gql.ts) in favor of modular architecture

pgpm/core & cli:

  • renamed and updated several test suites (e.g., stage-unique-names -> sample-unique-names-w-exts)
  • updated dependency resolution tests
  • general changelog and package.json updates
  • other packages:

also was testing with these:
https://github.com/constructive-io/constructive-cloud/pull/67

@Jovonni Jovonni requested a review from Anmol1696 January 6, 2026 02:54
@Jovonni Jovonni self-assigned this Jan 6, 2026
@Jovonni Jovonni added the enhancement New feature or request label Jan 6, 2026
@Jovonni
Copy link
Contributor Author

Jovonni commented Jan 6, 2026

ci passes but i dont see functions in there, idk if there will be an issue with running these function tests in ci/cd

@Jovonni Jovonni force-pushed the dev/hello-world-function-testing branch from 88b0b06 to 2aa7b8d Compare January 6, 2026 03:53
import React from 'react';
import { render, cleanup } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import '@testing-library/jest-dom';
Copy link
Contributor

Choose a reason for hiding this comment

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

I dont think this PR needs to touch the graphql/ dir.

res.status(200).json({ message: error.message });
});
app.listen(port, cb);
return app.listen(port, cb);
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe changes to the jobs/knative-job-fn not required in thie PR. If we have a cleanup or lint PR, could be seperated out?

} from '@constructive-io/job-utils';

// this module exists to fail fast on missing env
// it is intentionally evaluated at import time
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe not required or we need to create it as a standard for all the packages. We purposefully moved away from envvalid for all the jobs, that were enforcing env variables in favour of the @pgpm/env. So maybe we dont do this here.

// this module exists to fail fast on missing env
// it is intentionally evaluated at import time

function normalizeBaseUrl(raw: string): string {
Copy link
Contributor

Choose a reason for hiding this comment

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

this function i am all in for. We should have a normalization process. will make it better.

Copy link
Contributor

Choose a reason for hiding this comment

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

can be moved to job-utils??

}

const rawGatewayUrl =
process.env.KNATIVE_SERVICE_URL ||
Copy link
Contributor

Choose a reason for hiding this comment

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

we dont use process.env but @pgpm/env pacakge. I think have a look into the jobs-utils.

@@ -0,0 +1,173 @@
import { Logger } from '@pgpmjs/logger';
Copy link
Contributor

@Anmol1696 Anmol1696 Jan 6, 2026

Choose a reason for hiding this comment

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

Could we seperate out the PR for pgpm dump from the hello-world function??
If they are related I might be missing something?

FROM node:20-alpine

# Install Postgres and Bash
RUN apk add --no-cache postgresql postgresql-client postgresql-contrib bash
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you tell me about the Dockerfile.test, what it is going to be used for? I might not be understanding it correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants