Skip to content

Conversation

@nyannyacha
Copy link
Contributor

@nyannyacha nyannyacha commented Oct 28, 2025

What kind of change does this PR introduce?

Enhancement

Description

Make CLI conditionally toggle DENO_NO_PACKAGE_JSON based on what files are in each function folder.
This only applies when deploying functions locally/Docker and not using the deploy api.

Related supabase/supabase#38402
Towards FUNC-304

@nyannyacha nyannyacha requested a review from a team as a code owner October 28, 2025 07:39
@coveralls
Copy link

coveralls commented Oct 28, 2025

Pull Request Test Coverage Report for Build 18926015369

Details

  • 11 of 16 (68.75%) changed or added relevant lines in 2 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 54.718%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/functions/deploy/deploy.go 4 6 66.67%
internal/functions/deploy/bundle.go 7 10 70.0%
Files with Coverage Reduction New Missed Lines %
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 18900105989: -0.01%
Covered Lines: 6396
Relevant Lines: 11689

💛 - Coveralls

[functions.{{ . }}]
enabled = true
verify_jwt = true
use_package_json = false
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this is the right fix. Based on their example, the error seems to be caused by health function failing to import package.json on Windows.

Most likely we have a bug in path resolution that's preventing package.json at root repo directory from being volume mounted into the edge runtime container.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sweatybridge Hello qiao 😄

Well.... I think their reproduction code in that link you mentioned is definitely a bug, but I believe what they reproduce is actually a different bug that seems similar to the issue they're having.

Apparently, the cli is parsing the script directly and passing it a list of the paths that should be bound from the host to pass to Docker.
That link is reproducing a bug that occurred there, but the issue that originally caused that issue was that it was automatically reading the package.json and subtly changing the way the Deno codebase resolves modules.

This is a PR for that.

@nyannyacha nyannyacha force-pushed the ny/add-use-pkg-json-flag branch from 840f37d to 13e2832 Compare October 29, 2025 11:27
@nyannyacha nyannyacha changed the title fix: introduce new flag in function section to handle DENO_NO_PACKAGE_JSON fix: toggle DENO_NO_PACKAGE_JSON conditionally Oct 29, 2025
@nyannyacha nyannyacha marked this pull request as draft October 29, 2025 11:42
@nyannyacha nyannyacha force-pushed the ny/add-use-pkg-json-flag branch from 13e2832 to ee7d48f Compare October 29, 2025 11:54
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.

4 participants