Skip to content

chore: deprecate constructive/functions in favor of constructive-functions repo#1127

Open
Anmol1696 wants to merge 1 commit intomainfrom
chore/deprecate-functions-dir
Open

chore: deprecate constructive/functions in favor of constructive-functions repo#1127
Anmol1696 wants to merge 1 commit intomainfrom
chore/deprecate-functions-dir

Conversation

@Anmol1696
Copy link
Copy Markdown
Contributor

Summary

Phase 1 of removing duplicated function infrastructure from this repo. The simple-email and send-email-link function workloads now live in the dedicated constructive-functions repository (new architecture: handler.ts + fn-runtime + handler.json manifests, auto-generated workspace packages, k8s/Skaffold deployment). The hub (constructive-hub) already launches function processes from that submodule, so the copies here under functions/ are dead weight at runtime.

This PR removes functions/ and the unreachable cnc jobs up CLI command. The jobs/ directory is intentionally kept for a follow-up PR — the hub still resolves the job-server entrypoint from constructive/jobs/<server>/dist/run.js, and that path will be flipped to constructive-functions/job/<server>/dist/run.js in a separate hub PR before jobs/ itself can be retired.

Changes

  • Delete functions/ (both simple-email and send-email-link packages) and docker/functions/simple-email.Dockerfile.
  • Drop 'functions/*' from pnpm-workspace.yaml.
  • Remove cnc jobs up:
    • Delete packages/cli/src/commands/jobs.ts.
    • Drop its import + registration in packages/cli/src/commands.ts.
    • Drop the Jobs: section from packages/cli/src/utils/display.ts help text.
    • Drop @constructive-io/knative-job-service from packages/cli/package.json dependencies.
  • Surgical patch to jobs/knative-job-service to keep the workspace installable after functions/* is gone:
    • Drop the now-broken workspace deps on @constructive-io/{simple-email,send-email-link}-fn.
    • Empty the in-memory functionRegistry and widen FunctionName to string. The legacy in-process launcher will simply fail with "Unknown function" if invoked — acceptable because it's slated for removal in the follow-up PR.
  • Docs: update CLAUDE.md and AGENTS.md to point readers at constructive-functions.

Non-goals (deferred to follow-up PRs)

  • Removing jobs/ (still consumed by hub's client.ts:640).
  • Removing docker-compose.jobs.yml, docker-compose.local-email.yml, docker/jobs/.
  • Hub-side change to flip client.ts:640 from constructive/jobs/... to constructive-functions/job/....
  • Republishing @constructive-io/{simple-email,send-email-link}-fn from the new repo (separate coordination — note the new repo currently sits at v2.6.4 / v1.6.4 vs the v2.10.0 / v1.10.0 just removed here, and uses a different entrypoint shape).

Verification

  • pnpm install resolves with no workspace:^ errors after the registry/dep edits.
  • pnpm build green across all 87 workspace projects; jobs/knative-job-service/dist/ and packages/cli/dist/ produced.
  • node packages/cli/dist/index.js --help no longer lists jobs and renders cleanly.
  • Pre-existing pnpm lint failures (ESLint v9 config migration in graphile-upload-plugin, graphile-sql-expression-validator, graphql/gql-ast, packages/12factor-env) are unrelated to this PR — confirmed by re-running lint on the parent commit; same packages fail there.

Test plan

  • Sanity-check pnpm install && pnpm build on the branch.
  • Confirm cnc --help no longer advertises jobs up and unknown-command path still works.
  • Confirm consumers downstream do not import @constructive-io/{simple-email,send-email-link}-fn from this repo's workspace (they should use the npm-published versions or the new repo).
  • Coordinate hub PR that flips client.ts:640 to constructive-functions/job/server/dist/run.js before the follow-up that deletes jobs/.

…tions repo

The simple-email and send-email-link function workloads now live in the
dedicated constructive-functions repository under handler.ts +
fn-runtime, and the hub already launches functions from that submodule.
The copies under this repo's functions/ directory are no longer
referenced at runtime, so drop them along with the unreachable
cnc jobs up CLI command.

- Remove functions/ (both packages) and docker/functions/simple-email.Dockerfile.
- Drop 'functions/*' from pnpm-workspace.yaml.
- Delete packages/cli/src/commands/jobs.ts, its registration in
  commands.ts, the help text entries, and the
  @constructive-io/knative-job-service dep from packages/cli.
- Empty the jobs/knative-job-service function registry and drop the
  now-broken workspace deps on simple-email-fn / send-email-link-fn
  so the workspace still installs. jobs/ itself is kept for a
  follow-up PR pending the hub job-server cutover.
- Update CLAUDE.md / AGENTS.md to point readers at constructive-functions.
@Anmol1696 Anmol1696 force-pushed the chore/deprecate-functions-dir branch from d773f29 to 0381d9b Compare May 11, 2026 06:24
@socket-security
Copy link
Copy Markdown

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​semver@​7.7.11001007581100
Addedjs-yaml@​4.1.19710010081100
Addedrimraf@​6.1.39910010083100
Addedjiti@​2.6.19710010088100
Addedtypescript@​5.9.3100100909890
Addedsemver@​7.7.410010010091100

View full report

@socket-security
Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm entities is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: pnpm-lock.yamlnpm/entities@4.5.0

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/entities@4.5.0. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

Warn High
Obfuscated code: npm markdown-it is 91.0% likely obfuscated

Confidence: 0.91

Location: Package overview

From: pnpm-lock.yamlnpm/markdown-it@14.1.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/markdown-it@14.1.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

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.

1 participant