Skip to content

[API-BOT] Update OpenAPI spec and regenerate SDK - #98

Open
platformsh-devrel wants to merge 1 commit into
mainfrom
update-openapi-spec
Open

platformsh-devrel wants to merge 1 commit into
mainfrom
update-openapi-spec

Conversation

@platformsh-devrel

Copy link
Copy Markdown
Collaborator

This PR updates the OpenAPI spec from the upstream source and applies formatting changes.

🧾 API Coverage Report

  • Total API methods: 265
  • Called from facades: 191
  • Unmapped API methods: 74
  • Invalid Facade API calls: 0
  • Coverage: 72.08%
📋 Full JSON report
{
  "total_api_methods": 265,
  "called_methods": 191,
  "unmapped_methods": [
    "Upsun\\Api\\AutoscalingApi::patchAutoscalerSettings",
    "Upsun\\Api\\SystemInformationApi::actionProjectsSystemRestart",
    "Upsun\\Api\\BlackfireMonitoringApi::blackfirePhpServerCaches",
    "Upsun\\Api\\BlackfireMonitoringApi::blackfireServerGlobal",
    "Upsun\\Api\\BlackfireMonitoringApi::blackfireServerTopSpans",
    "Upsun\\Api\\BlackfireMonitoringApi::blackfireServerTransactionsBreakdown",
    "Upsun\\Api\\ContinuousProfilingApi::getApplicationFilter",
    "Upsun\\Api\\ContinuousProfilingApi::getApplicationMerge",
    "Upsun\\Api\\ContinuousProfilingApi::getApplicationTimeline",
    "Upsun\\Api\\ContinuousProfilingApi::listApplications",
    "Upsun\\Api\\HttpTrafficApi::httpMetricsTimelineIps",
    "Upsun\\Api\\HttpTrafficApi::httpMetricsTimelineUrls",
    "Upsun\\Api\\HttpTrafficApi::httpMetricsTimelineUserAgents",
    "Upsun\\Api\\OrganizationProjectsApi::createOrgProject",
    "Upsun\\Api\\OrganizationProjectsApi::deleteOrgProject",
    "Upsun\\Api\\OrganizationProjectsApi::getOrgProject",
    "Upsun\\Api\\OrganizationProjectsApi::queryProjectCarbon",
    "Upsun\\Api\\OrganizationProjectsApi::streamOrgProjectProvisioning",
    "Upsun\\Api\\ProjectApi::maintenanceRedeployProject",
    "Upsun\\Api\\AlertsApi::getUsageAlerts",
    "Upsun\\Api\\AlertsApi::updateUsageAlerts",
    "Upsun\\Api\\ReferencesApi::listReferencedOrgs",
    "Upsun\\Api\\ReferencesApi::listReferencedProjects",
    "Upsun\\Api\\ReferencesApi::listReferencedRegions",
    "Upsun\\Api\\ReferencesApi::listReferencedTeams",
    "Upsun\\Api\\ReferencesApi::listReferencedUsers",
    "Upsun\\Api\\DiffApi::listProjectsGitDiffs",
    "Upsun\\Api\\UsersApi::getCurrentUserDeprecated",
    "Upsun\\Api\\TaskApi::getProjectsEnvironmentsTasks",
    "Upsun\\Api\\TaskApi::listProjectsEnvironmentsTasks",
    "Upsun\\Api\\TaskApi::runTask",
    "Upsun\\Api\\DefaultApi::queryOrganiationCarbon",
    "Upsun\\Api\\DeploymentTargetApi::createProjectsDeployments",
    "Upsun\\Api\\DeploymentTargetApi::deleteProjectsDeployments",
    "Upsun\\Api\\DeploymentTargetApi::getProjectsDeployments",
    "Upsun\\Api\\DeploymentTargetApi::listProjectsDeployments",
    "Upsun\\Api\\DeploymentTargetApi::updateProjectsDeployments",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfileGraph",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfileProfile",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfileSubprofiles",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfileTimeline",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfilesList",
    "Upsun\\Api\\BlackfireProfilingApi::blackfireProfilesRecommendations",
    "Upsun\\Api\\CertManagementApi::getProjectsProvisioners",
    "Upsun\\Api\\CertManagementApi::listProjectsProvisioners",
    "Upsun\\Api\\CertManagementApi::updateProjectsProvisioners",
    "Upsun\\Api\\OrganizationManagementApi::estimateOrg",
    "Upsun\\Api\\OrganizationManagementApi::getOrgBillingAlertConfig",
    "Upsun\\Api\\OrganizationManagementApi::getOrgPrepaymentInfo",
    "Upsun\\Api\\OrganizationManagementApi::listOrgPrepaymentTransactions",
    "Upsun\\Api\\OrganizationManagementApi::updateOrgBillingAlertConfig",
    "Upsun\\Api\\DomainClaimApi::createProjectsDomainClaims",
    "Upsun\\Api\\DomainClaimApi::deleteProjectsDomainClaims",
    "Upsun\\Api\\DomainClaimApi::getProjectsDomainClaims",
    "Upsun\\Api\\DomainClaimApi::listProjectsDomainClaims",
    "Upsun\\Api\\DomainClaimApi::updateProjectsDomainClaims",
    "Upsun\\Api\\ProjectsApi::listOrgProjectHistory",
    "Upsun\\Api\\DiscountsApi::getDiscount",
    "Upsun\\Api\\DiscountsApi::getTypeAllowance",
    "Upsun\\Api\\DiscountsApi::listOrgDiscounts",
    "Upsun\\Api\\EntrypointApi::observabilityEntrypoint",
    "Upsun\\Api\\GrantsApi::getAccessDocument",
    "Upsun\\Api\\ResourcesApi::resourcesByService",
    "Upsun\\Api\\ResourcesApi::resourcesOverview",
    "Upsun\\Api\\ResourcesApi::resourcesSummary",
    "Upsun\\Api\\SubscriptionsApi::canAffordSubscription",
    "Upsun\\Api\\SubscriptionsApi::canUpdateSubscription",
    "Upsun\\Api\\SubscriptionsApi::getSubscriptionUsageAlerts",
    "Upsun\\Api\\SubscriptionsApi::listSubscriptionAddons",
    "Upsun\\Api\\SubscriptionsApi::updateOrgSubscription",
    "Upsun\\Api\\SubscriptionsApi::updateSubscriptionUsageAlerts",
    "Upsun\\Api\\EnvironmentApi::deployEnvironment",
    "Upsun\\Api\\EnvironmentApi::maintenanceRedeployEnvironment",
    "Upsun\\Api\\UserProfilesApi::createProfilePicture"
  ],
  "invalid_facade_calls": [],
  "coverage_percentage": 72.08
}

@upsun-dispatch

upsun-dispatch Bot commented Sep 5, 2026

Copy link
Copy Markdown

📋 PR Summary

Regenerates the PHP SDK from an updated upstream OpenAPI spec. The main functional changes are new egress-allowlist modelling for containers (project-level egress proxy capability plus build/runtime allowed-domain lists on web apps and workers), a new backup size_object_storage field, an autoscaling supports_horizontal_scaling_services capability, the removal of the OCI registry-credential and SBOM endpoints/models, and @deprecated annotations on a large set of billing/organization operations.

Changes
Layer / File(s) Summary
OpenAPI spec
schema/openapispec-upsun.json Marks many billing, orders, profiles, records, subscriptions and vouchers operations as deprecated; drops the oci-registries and sboms paths and their schemas; adds egress/egress_proxy, backup size_object_storage, autoscaling supports_horizontal_scaling_services, an UnprocessableEntity response and extra 409/422 responses; reorders and rewords container-related properties (web apps, workers, tasks).
Deprecation annotations in generated API clients
src/Api/AddOnsApi.php Adds @deprecated tags to getOrgAddons and its helpers.
src/Api/DiscountsApi.php Adds @deprecated tags to listOrgDiscounts and its helpers.
src/Api/InvoicesApi.php Adds @deprecated tags to getOrgInvoice and listOrgInvoices and their helpers.
src/Api/OrdersApi.php Adds @deprecated tags to createAuthorizationCredentials, getOrgOrder and listOrgOrders.
src/Api/OrganizationManagementApi.php Adds @deprecated tags to the estimate, billing-alert-config and prepayment operations.
src/Api/ProfilesApi.php Adds @deprecated tags to the organization address and profile get/update operations.
src/Api/RecordsApi.php Adds @deprecated tags to listOrgPlanRecords and listOrgUsageRecords.
src/Api/SubscriptionsApi.php Adds @deprecated tags to the estimate, current-usage, usage-alerts and addon-listing subscription operations.
src/Api/VouchersApi.php Adds @deprecated tags to applyOrgVoucher and listOrgVouchers.
Removed endpoints and models
src/Api/RegistryCredentialApi.php Deleted along with the removal of the /projects/{projectId}/oci-registries endpoints from the spec.
src/Api/SbomApi.php Deleted along with the removal of the deployment SBOM endpoints from the spec.
src/Model/RegistryCredential.php Removed registry credential model.
src/Model/RegistryCredentialCreateInput.php Removed registry credential creation input model.
src/Model/RegistryCredentialPatch.php Removed registry credential patch model.
src/Model/BasicAuth.php Removed; it was only used by the registry credential models.
New egress models
src/Model/Egress.php New model holding nullable build- and runtime-phase egress allowlists.
src/Model/BuildPhaseEgress.php New model wrapping the build-phase allowed domains list.
src/Model/RuntimePhaseEgress.php New model wrapping the runtime-phase allowed domains list.
src/Model/AllowedDomainsInner.php New model for an allowed destination (host plus optional port).
src/Model/EgressProxy.php New project-capability model exposing whether the project-wide egress proxy is enabled.
Updated models
src/Model/ProjectCapabilities.php Adds the nullable egressProxy capability.
src/Model/Autoscaling.php Adds the required supportsHorizontalScalingServices flag and its getter.
src/Model/Backup.php Adds the nullable sizeObjectStorage property, serialization entry and getter.
src/Model/WebApplicationsValue.php Reorders constructor properties to match the spec and adds the nullable egress property.
src/Model/WorkersValue.php Reorders constructor properties to match the spec and adds the nullable egress property.
src/Model/Task.php Reorders the task properties (resources, authorizations and container profile moved earlier) to match the regenerated spec.
Serializer mappers
src/Api/Serializer/ApiObjectAttributesMapper.php Adds entries for the new egress and allowed-domain models plus the new backup and autoscaling fields, removes the registry-credential/BasicAuth entries and reorders container/task property maps.
src/Api/Serializer/ApiObjectFormatsMapper.php Mirrors the same additions, removals and reordering in the format map.
src/Api/Serializer/ApiObjectTypesMapper.php Mirrors the same additions, removals and reordering in the type map, wiring egress to the new model classes.

@upsun-dispatch upsun-dispatch Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Changes suggested — 🟡 2 warnings · 🔵 1 minor point

🔍 Full review · 30 files reviewed

Verification
  • No source or test file still references the deleted RegistryCredentialApi, SbomApi, BasicAuth, RegistryCredential* classes (repo-wide grep, including UpsunClient wiring).
  • The new egress / egressProxy properties are nullable with matching entries in all three mapper files, so absent fields deserialize to null rather than throwing.
  • Egress, EgressProxy, BuildPhaseEgress and RuntimePhaseEgress getters/jsonSerialize match their constructor promotions and the spec's build/runtime shape.
  • Backup::$sizeObjectStorage is ?int, so responses omitting size_object_storage still deserialize successfully.

No tests were added or changed in this diff; the repository's develop.yml workflow runs composer run lint:all (phpcs, rector, php-cs-fixer) and composer run test:unit, and the existing tests/Core/Tasks/ProjectsTaskTest.php::testGetCapabilities fixture omits the newly required supports_horizontal_scaling_services field (I reproduced the resulting InvalidArgumentException with a standalone script against src/).

Review details
  • Commit: 212e866
  • Model: claude-opus-5

Review 1 of 10 for this pull request · View the full run

Comment thread src/Model/Autoscaling.php
{
public function __construct(
private readonly bool $enabled,
private readonly bool $supportsHorizontalScalingServices,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Warning — Any capabilities response lacking the new field crashes; existing unit test fails.

Autoscaling::__construct gains a non-nullable, no-default bool $supportsHorizontalScalingServices. ObjectSerializer::deserializeSimplifiedModel() resolves the value via the attribute map key supports_horizontal_scaling_services; when the payload omits it the value is null, $allowsNull is false, and ApiObjectTypesMapper reports 'bool' (no null), so the final guard throws InvalidArgumentException: Required value 'supportsHorizontalScalingServices' missing for class Upsun\Model\Autoscaling. I reproduced this against the repository's own fixtures: deserializing ['autoscaling' => ['enabled' => true]] (the shape used in tests/Core/Tasks/ProjectsTaskTest.php::testGetCapabilities and BaseTestCase) aborts the whole ProjectCapabilities deserialization with that exception, so ProjectsTask::getCapabilities() fails for any API response that does not yet return the new field.

],

'Upsun\Model\BuildPhaseEgress' => [
'allowed_domains' => '\Upsun\Model\AllowedDomainsInner[]',

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Warning — New getters return arrays, not the documented model objects, breaking consumers.

BuildPhaseEgress/RuntimePhaseEgress declare allowed_domains => '\Upsun\Model\AllowedDomainsInner[]', but ObjectSerializer::deserializeSimplifiedModel() looks the item type up with the camelCase constructor parameter name ($types[$paramName], i.e. allowedDomains). The snake_case key never matches, so the fallback path stores the raw payload. Running the deserializer on ['build' => ['allowed_domains' => [['host' => 'a.com','port' => null]]]] yields Egress::getBuild()->getAllowedDomains() === [['host' => 'a.com','port' => null]] — plain arrays, contradicting the @return AllowedDomainsInner[] docblock, so caller code doing ->getHost() fatals. (The camel/snake mismatch is a pre-existing generator/serializer issue; this change adds the first multi-word array-of-model property on the new egress models.)

Comment thread src/Model/Backup.php
private readonly ?int $index,
private readonly ?int $sizeOfVolumes,
private readonly ?int $sizeUsed,
private readonly ?int $sizeObjectStorage,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Minor — Silent positional-argument breakage for library consumers on a patch-looking update.

sizeObjectStorage is inserted into the middle of Backup::__construct, and the same regeneration reorders the constructor parameter lists of Task, WebApplicationsValue and WorkersValue (resources/authorizations moved ahead of type/size/disk/access). Deserialization is by name so it is unaffected, but any downstream code that constructs these readonly value objects positionally now silently binds values to the wrong parameters or fails type checks after a simple composer update of this published library.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants