Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable edge runtime inspector feature #2308

Merged
merged 21 commits into from
May 29, 2024

Conversation

nyannyacha
Copy link
Contributor

@nyannyacha nyannyacha commented May 23, 2024

What kind of change does this PR introduce?

Feature
closes #2311
closes supabase/edge-runtime#212

Description

This PR introduces several flags to the supabase functions serve command to enable the inspector capability of edge-runtime.

See the doc added to this PR for about these flags.

@coveralls
Copy link

coveralls commented May 23, 2024

Pull Request Test Coverage Report for Build 9280055496

Details

  • 39 of 73 (53.42%) changed or added relevant lines in 4 files are covered.
  • 9 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.1%) to 60.189%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/utils/config.go 3 6 50.0%
cmd/functions.go 5 14 35.71%
internal/functions/serve/serve.go 30 52 57.69%
Files with Coverage Reduction New Missed Lines %
internal/functions/serve/serve.go 2 64.19%
internal/storage/rm/rm.go 2 89.53%
internal/gen/keys/keys.go 5 11.76%
Totals Coverage Status
Change from base Build 9271086176: -0.1%
Covered Lines: 6888
Relevant Lines: 11444

💛 - Coveralls

@nyannyacha
Copy link
Contributor Author

I've made it possible to change the host port for accepting inspector sessions in the experimental section, but a recent commit seems to have added an extra edge_runtime section.

Is it better to keep it as it is, or better to move functions_inspector_port to the edge_runtime section?

@nyannyacha nyannyacha marked this pull request as ready for review May 23, 2024 22:39
@nyannyacha nyannyacha requested a review from a team as a code owner May 23, 2024 22:39
@nyannyacha

This comment was marked as outdated.

Copy link
Contributor

@sweatybridge sweatybridge left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks. LGTM

cmd/functions.go Outdated Show resolved Hide resolved
cmd/functions.go Outdated Show resolved Hide resolved
internal/functions/serve/serve.go Outdated Show resolved Hide resolved
@nyannyacha

This comment was marked as outdated.

@nyannyacha
Copy link
Contributor Author

nyannyacha commented May 27, 2024

Serve all Functions locally

Usage:
  supabase functions serve [flags]

Flags:
      --env-file string                     Path to an env file to be populated to the Function environment.
  -h, --help                                help for serve
      --import-map string                   Path to import map file.
      --inspect                             Alias of --inspect-mode run.
      --inspect-main                        Allow inspecting the main worker.
      --inspect-mode [ run | brk | wait ]   Activate inspector capability for debugging.
      --no-verify-jwt                       Disable JWT verification for the Function.

Global Flags:
      --create-ticket                     create a support ticket for any CLI error
      --debug                             output debug logs to stderr
      --dns-resolver [ native | https ]   lookup domain names using the specified resolver (default native)
      --experimental                      enable experimental features
      --workdir string                    path to a Supabase project directory
A new version of Supabase CLI is available: v1.169.8 (currently installed v)
We recommend updating regularly for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli

@sweatybridge sweatybridge merged commit 6ff7f50 into supabase:develop May 29, 2024
13 checks passed
@nyannyacha nyannyacha deleted the feat-er-inspect branch May 29, 2024 04:20
@github-actions github-actions bot mentioned this pull request May 31, 2024
Albert-S2 added a commit to lazycloud0/KingsHeathClangersApp that referenced this pull request Jul 8, 2024
<p>This PR was automatically created by Snyk using the credentials of a
real user.</p><br
/>![snyk-top-banner](https://github.com/andygongea/OWASP-Benchmark/assets/818805/c518c423-16fe-447e-b67f-ad5a49b5d123)


<h3>Snyk has created this PR to upgrade supabase from 1.170.1 to
1.172.0.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.

<hr/>


- The recommended version is **2 versions** ahead of your current
version.

- The recommended version was released on **21 days ago**.



<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>supabase</b></summary>
    <ul>
      <li>
<b>1.172.0</b> - <a
href="https://github.com/supabase/cli/releases/tag/v1.172.0">2024-05-29</a></br><h2>Changelog</h2>
<h3>Features</h3>
<ul>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/5b6ba08910fbcc20963a7ce967232e999ca55f2e/hovercard"
href="https://github.com/supabase/cli/commit/5b6ba08910fbcc20963a7ce967232e999ca55f2e"><tt>5b6ba08</tt></a>:
feat: support loading site url from env var (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="2322963332" data-permission-text="Title is private"
data-url="supabase/cli#2338"
data-hovercard-type="pull_request"
data-hovercard-url="/supabase/cli/pull/2338/hovercard"
href="https://github.com/supabase/cli/pull/2338">#2338</a>) (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
</ul>
<h3>Others</h3>
<ul>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/f2983ed577c57ece351f14cd06be67322e4bdbf0/hovercard"
href="https://github.com/supabase/cli/commit/f2983ed577c57ece351f14cd06be67322e4bdbf0"><tt>f2983ed</tt></a>:
chore: update codegen to v2 (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/7eaea97446e94ff2b390df734a7e263bb7b32d0e/hovercard"
href="https://github.com/supabase/cli/commit/7eaea97446e94ff2b390df734a7e263bb7b32d0e"><tt>7eaea97</tt></a>:
chore: bump go version to 1.22.3 (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/9ca65b80b634006a8165e047f5886920030a8724/hovercard"
href="https://github.com/supabase/cli/commit/9ca65b80b634006a8165e047f5886920030a8724"><tt>9ca65b8</tt></a>:
chore: bump codeql analysis (<a class="user-mention notranslate"
data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/6354fc6d798fab85f6813c93297054973a226e06/hovercard"
href="https://github.com/supabase/cli/commit/6354fc6d798fab85f6813c93297054973a226e06"><tt>6354fc6</tt></a>:
chore: update openapi spec (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="2322727596"
data-permission-text="Title is private"
data-url="supabase/cli#2337"
data-hovercard-type="pull_request"
data-hovercard-url="/supabase/cli/pull/2337/hovercard"
href="https://github.com/supabase/cli/pull/2337">#2337</a>) (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
</ul>
      </li>
      <li>
<b>1.171.0</b> - <a
href="https://github.com/supabase/cli/releases/tag/v1.171.0">2024-05-29</a></br><h2>Changelog</h2>
<h3>Features</h3>
<ul>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/6ff7f5000a366c78636db8e83e834c143bb2e928/hovercard"
href="https://github.com/supabase/cli/commit/6ff7f5000a366c78636db8e83e834c143bb2e928"><tt>6ff7f50</tt></a>:
feat: enable edge runtime inspector feature (<a class="issue-link
js-issue-link" data-error-text="Failed to load title"
data-id="2311813509" data-permission-text="Title is private"
data-url="supabase/cli#2308"
data-hovercard-type="pull_request"
data-hovercard-url="/supabase/cli/pull/2308/hovercard"
href="https://github.com/supabase/cli/pull/2308">#2308</a>) (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/nyannyacha/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/nyannyacha">@ nyannyacha</a>)</li>
</ul>
      </li>
      <li>
<b>1.170.1</b> - <a
href="https://github.com/supabase/cli/releases/tag/v1.170.1">2024-05-28</a></br><h2>Changelog</h2>
<h3>Bug fixes</h3>
<ul>
<li><a class="commit-link" data-hovercard-type="commit"
data-hovercard-url="https://github.com/supabase/cli/commit/672a9fb6691d99fa78e9e79569e33d40f87b25e2/hovercard"
href="https://github.com/supabase/cli/commit/672a9fb6691d99fa78e9e79569e33d40f87b25e2"><tt>672a9fb</tt></a>:
Revert "fix: bump studio to latest" (<a class="issue-link js-issue-link"
data-error-text="Failed to load title" data-id="2321089512"
data-permission-text="Title is private"
data-url="supabase/cli#2332"
data-hovercard-type="pull_request"
data-hovercard-url="/supabase/cli/pull/2332/hovercard"
href="https://github.com/supabase/cli/pull/2332">#2332</a>) (<a
class="user-mention notranslate" data-hovercard-type="user"
data-hovercard-url="/users/sweatybridge/hovercard"
data-octo-click="hovercard-link-click"
data-octo-dimensions="link_type:self"
href="https://github.com/sweatybridge">@ sweatybridge</a>)</li>
</ul>
      </li>
    </ul>
from <a href="https://github.com/supabase/cli/releases">supabase GitHub
release notes</a>
  </details>
</details>

---

> [!IMPORTANT]
>
> - Check the changes in this PR to ensure they won't cause issues with
your project.
> - This PR was automatically created by Snyk using the credentials of a
real user.

---

**Note:** _You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs._

**For more information:** <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiJmNWNlODUwNi0wZGViLTRiMTAtYjliZC0zYTg0Y2E1Y2Y5NDgiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6ImY1Y2U4NTA2LTBkZWItNGIxMC1iOWJkLTNhODRjYTVjZjk0OCJ9fQ=="
width="0" height="0"/>

> - 🧐 [View latest project
report](https://app.snyk.io/org/josetutis/project/3c402998-992a-4249-ae7b-830abf69abcf?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 📜 [Customise PR
templates](https://docs.snyk.io/scan-using-snyk/pull-requests/snyk-fix-pull-or-merge-requests/customize-pr-templates)
> - 🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/josetutis/project/3c402998-992a-4249-ae7b-830abf69abcf/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)
> - 🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/josetutis/project/3c402998-992a-4249-ae7b-830abf69abcf/settings/integration?pkg&#x3D;supabase&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"customTemplate":{"variablesUsed":[],"fieldsUsed":[]},"dependencies":[{"name":"supabase","from":"1.170.1","to":"1.172.0"}],"env":"prod","hasFixes":false,"isBreakingChange":false,"isMajorUpgrade":false,"issuesToFix":[],"prId":"f5ce8506-0deb-4b10-b9bd-3a84ca5cf948","prPublicId":"f5ce8506-0deb-4b10-b9bd-3a84ca5cf948","packageManager":"npm","priorityScoreList":[],"projectPublicId":"3c402998-992a-4249-ae7b-830abf69abcf","projectUrl":"https://app.snyk.io/org/josetutis/project/3c402998-992a-4249-ae7b-830abf69abcf?utm_source=github&utm_medium=referral&page=upgrade-pr","prType":"upgrade","templateFieldSources":{"branchName":"default","commitMessage":"default","description":"default","title":"default"},"templateVariants":[],"type":"auto","upgrade":[],"upgradeInfo":{"versionsDiff":2,"publishedDate":"2024-05-29T10:42:32.158Z"},"vulns":[]})
--->
@escopecz
Copy link

Is there some tutorial about how to use this? Will this work with the VS Code debugger?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants