Skip to content

feat: add services array to distinguish function and site runtimes#105

Merged
Meldiron merged 6 commits into
mainfrom
feat-runtime-type
Jun 3, 2026
Merged

feat: add services array to distinguish function and site runtimes#105
Meldiron merged 6 commits into
mainfrom
feat-runtime-type

Conversation

@HarshMN2345

Copy link
Copy Markdown
Member

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a services array to the Runtime class to distinguish which service category (functions or sites) each runtime supports. The static and flutter runtimes are marked as sites-only while all others default to both.

  • Adds SERVICE_FUNCTIONS/SERVICE_SITES constants, getServices()/setServices() with input validation, and includes services in the list() output.
  • Marks static and flutter as site-only runtimes in Runtimes.php.
  • New tests cover constructor/setter validation, list() output shape, and site-only runtime assertions.

Confidence Score: 5/5

Safe to merge; the change is additive and well-tested with no impact on existing runtime behavior.

The new services field is additive, the validation logic is straightforward, and the test suite covers the main paths including error cases. No existing behavior is altered — all runtimes that previously had no services argument now receive the same default of both services.

No files require special attention.

Important Files Changed

Filename Overview
src/Runtimes/Runtime.php Adds $services property, two constants, getServices()/setServices() with validation, and surfaces services in list() output. Validation guards for empty arrays and unknown values are present; duplicate entries are not deduplicated.
src/Runtimes/Runtimes.php Marks static and flutter runtimes as SERVICE_SITES-only; all other runtimes keep the default [SERVICE_FUNCTIONS, SERVICE_SITES]. Change is straightforward and correct.
tests/Runtimes/RuntimesTest.php Good coverage for the new feature: tests constructor throws on empty/invalid services, setServices validation, list() output shape, and site-only runtimes. One test hardcodes node-18.0 as the version key which could become a maintenance burden if that version is removed.

Reviews (5): Last reviewed commit: "fix: add PHPDoc type hint to satisfy PHP..." | Re-trigger Greptile

Comment thread src/Runtimes/Runtime.php Outdated
@HarshMN2345 HarshMN2345 changed the title feat: add type field to distinguish function and site runtimes feat: add services array to distinguish function and site runtimes Jun 3, 2026
Comment thread src/Runtimes/Runtime.php Outdated
Comment thread src/Runtimes/Runtime.php Outdated
Comment thread src/Runtimes/Runtime.php
Comment thread src/Runtimes/Runtime.php Outdated
@Meldiron Meldiron merged commit ae3ab62 into main Jun 3, 2026
7 checks passed
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