Skip to content

Migrate API from v1alpha1 to v1beta1#385

Merged
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:update-api-to-v1beta1
Nov 26, 2025
Merged

Migrate API from v1alpha1 to v1beta1#385
celdrake merged 1 commit into
flightctl:mainfrom
celdrake:update-api-to-v1beta1

Conversation

@celdrake

@celdrake celdrake commented Nov 25, 2025

Copy link
Copy Markdown
Collaborator

API has been moved from v1alpha1 to v1beta1.

Summary by CodeRabbit

  • Chores

    • Migrated to API v1beta1 and centralized API version usage across tests, interceptors, UI components, and proxy authentication handlers.
    • Updated OpenAPI source to v1beta1 and bumped proxy dependency to align with the new API surface.
  • Documentation

    • Clarified JSDoc for image application provider to indicate OCI image/artifact support.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 25, 2025

Copy link
Copy Markdown

Walkthrough

Migrate API surface from v1alpha1 to v1beta1: introduce centralized API_VERSION constant in Cypress support, update fixtures/interceptors to use it, change UI constant, update OpenAPI source and JSDoc, and replace Go imports/types/signatures in proxy authentication to v1beta1; update proxy module dependency.

Changes

Cohort / File(s) Summary
Cypress fixtures: API version constant adoption
libs/cypress/fixtures/auth/organization.ts, libs/cypress/fixtures/enrollmentRequests/index.ts, libs/cypress/fixtures/fleets/initialFleets.ts, libs/cypress/fixtures/repositories/initialRepositories.ts
Import API_VERSION from support constants and replace hard-coded 'v1alpha1' apiVersion values with API_VERSION.
Cypress support: API version constant & interceptors
libs/cypress/support/constants.ts, libs/cypress/support/interceptors/auth.ts, libs/cypress/support/interceptors/devices.ts, libs/cypress/support/interceptors/enrollmentRequests.ts, libs/cypress/support/interceptors/fleets.ts, libs/cypress/support/interceptors/repositories.ts
Add export const API_VERSION = 'v1beta1' and update interceptor response bodies to use API_VERSION instead of literal 'v1alpha1'.
UI components: API version constant migration
libs/ui-components/src/constants.ts, libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts
Change API_VERSION constant from 'v1alpha1' to 'v1beta1' and use the constant in auth provider utilities.
Types & OpenAPI generation
libs/types/models/ImageApplicationProviderSpec.ts, libs/types/scripts/openapi-typescript.js
Update JSDoc for image field to reference OCI artifacts; update OpenAPI source URL from v1alpha1 to v1beta1.
Go proxy auth: API type migration to v1beta1
proxy/auth/aap.go, proxy/auth/api_client.go, proxy/auth/auth.go, proxy/auth/common.go, proxy/auth/k8s.go, proxy/auth/oauth2.go, proxy/auth/oidc.go, proxy/auth/openshift.go
Replace imports from api/v1alpha1api/v1beta1; update function signatures, parameter and return types, and type usages across auth handlers and token/config processing to v1beta1 equivalents.
Module dependency
proxy/go.mod
Update github.com/flightctl/flightctl pseudo-version to a newer commit that includes v1beta1 API.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Attention areas:
    • Ensure all callers of modified Go functions/types in proxy/ (outside this diff) were updated or remain compatible with v1beta1 signatures.
    • Verify the new github.com/flightctl/flightctl module version contains the expected v1beta1 API types and that go mod tidy builds cleanly.
    • Confirm Cypress fixtures/interceptors consistently import and use the new API_VERSION constant.
    • Check for any runtime assumptions or string comparisons elsewhere that may still expect v1alpha1.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 68.75% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Migrate API from v1alpha1 to v1beta1' accurately and concisely summarizes the main objective of the changeset, which is migrating all API version references throughout the codebase from v1alpha1 to v1beta1.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d46b473 and ad48b93.

⛔ Files ignored due to path filters (1)
  • proxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (23)
  • libs/cypress/fixtures/auth/organization.ts (1 hunks)
  • libs/cypress/fixtures/enrollmentRequests/index.ts (5 hunks)
  • libs/cypress/fixtures/fleets/initialFleets.ts (3 hunks)
  • libs/cypress/fixtures/repositories/initialRepositories.ts (1 hunks)
  • libs/cypress/support/constants.ts (1 hunks)
  • libs/cypress/support/interceptors/auth.ts (2 hunks)
  • libs/cypress/support/interceptors/devices.ts (1 hunks)
  • libs/cypress/support/interceptors/enrollmentRequests.ts (1 hunks)
  • libs/cypress/support/interceptors/fleets.ts (1 hunks)
  • libs/cypress/support/interceptors/repositories.ts (1 hunks)
  • libs/types/models/ImageApplicationProviderSpec.ts (1 hunks)
  • libs/types/scripts/openapi-typescript.js (1 hunks)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts (2 hunks)
  • libs/ui-components/src/constants.ts (1 hunks)
  • proxy/auth/aap.go (2 hunks)
  • proxy/auth/api_client.go (6 hunks)
  • proxy/auth/auth.go (12 hunks)
  • proxy/auth/common.go (2 hunks)
  • proxy/auth/k8s.go (2 hunks)
  • proxy/auth/oauth2.go (2 hunks)
  • proxy/auth/oidc.go (2 hunks)
  • proxy/auth/openshift.go (2 hunks)
  • proxy/go.mod (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • proxy/auth/k8s.go
  • libs/ui-components/src/constants.ts
  • libs/cypress/fixtures/enrollmentRequests/index.ts
  • libs/cypress/support/constants.ts
  • proxy/auth/common.go
  • libs/cypress/support/interceptors/repositories.ts
  • proxy/auth/aap.go
  • libs/types/scripts/openapi-typescript.js
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts
  • libs/cypress/fixtures/repositories/initialRepositories.ts
  • libs/cypress/support/interceptors/auth.ts
  • proxy/auth/api_client.go
  • proxy/auth/oauth2.go
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 371
File: libs/types/models/AppType.ts:10-10
Timestamp: 2025-10-29T16:47:29.614Z
Learning: PR #371 (flightctl/flightctl-ui) adds the AppTypeQuadlet enum member and related types as a preparatory change. Full implementation of quadlet application support in the UI will be added later, after backend support is available.
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 0
File: :0-0
Timestamp: 2025-02-17T08:41:57.993Z
Learning: All files in `libs/types/models` are auto-generated using OpenAPI Generator from the schema defined in https://github.com/flightctl/flightctl/blob/main/api/v1alpha1/openapi.yaml. Changes to these files should be made in the schema instead of modifying the generated files directly.
📚 Learning: 2025-01-07T10:11:14.375Z
Learnt from: rawagner
Repo: flightctl/flightctl-ui PR: 181
File: proxy/config/ocp.go:16-16
Timestamp: 2025-01-07T10:11:14.375Z
Learning: In the flightctl-ui repository, the `RBACNs` variable used in `proxy/config/ocp.go` is defined in `proxy/config/config.go` as a package-level variable that retrieves its value from the environment variable `K8S_RBAC_NS`.

Applied to files:

  • proxy/auth/oidc.go
  • proxy/auth/openshift.go
🧬 Code graph analysis (6)
libs/cypress/support/interceptors/enrollmentRequests.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/fixtures/auth/organization.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/fixtures/fleets/initialFleets.ts (3)
libs/types/index.ts (1)
  • Fleet (100-100)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/support/interceptors/devices.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
proxy/auth/openshift.go (2)
libs/types/index.ts (2)
  • AuthProvider (25-25)
  • OpenShiftProviderSpec (143-143)
libs/types/models/OpenShiftProviderSpec.ts (1)
  • OpenShiftProviderSpec (8-49)
proxy/auth/auth.go (5)
libs/types/models/AuthConfig.ts (1)
  • AuthConfig (6-23)
proxy/auth/common.go (1)
  • AuthProvider (70-76)
libs/types/models/AuthProvider.ts (1)
  • AuthProvider (10-21)
libs/types/models/TokenRequest.ts (1)
  • TokenRequest (8-37)
libs/types/models/TokenResponse.ts (1)
  • TokenResponse (8-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: integration-tests
  • GitHub Check: Build ocp plugin
  • GitHub Check: Build
  • GitHub Check: Lint
🔇 Additional comments (14)
libs/types/models/ImageApplicationProviderSpec.ts (1)

10-10: LGTM! Documentation improvement reflects the v1beta1 schema update.

The updated JSDoc comment is more precise—"OCI image or artifact" is technically more accurate than "container image" and appropriately broadens the scope. Since this file is auto-generated from the OpenAPI schema, this change correctly reflects the v1alpha1 to v1beta1 migration.

Based on learnings, this file is auto-generated from the OpenAPI schema and should not be manually edited.

libs/cypress/support/interceptors/enrollmentRequests.ts (1)

3-7: Centralizing apiVersion via API_VERSION looks good

Importing API_VERSION and using it in buildErResponse keeps enrollment request responses consistent with the configured API version and avoids hard-coded strings. No issues spotted.

libs/cypress/fixtures/auth/organization.ts (1)

1-5: Fixture now tracks API version correctly

Using API_VERSION for defaultOrg.apiVersion aligns this auth fixture with the rest of the Cypress setup and avoids a stale hard-coded value.

libs/cypress/support/interceptors/devices.ts (1)

2-6: Device interceptor correctly migrated to API_VERSION

buildDevicesResponse now uses the shared API_VERSION constant, keeping device list responses in sync with the configured API version while preserving existing behavior.

libs/cypress/fixtures/fleets/initialFleets.ts (1)

2-7: Fleet fixtures updated to use shared API_VERSION

Both basicFleets entries now take apiVersion from API_VERSION, which will keep these fixtures aligned with version changes. The added trailing commas in devicesSummary.updateStatus are purely formatting and safe.

Also applies to: 45-52, 56-57, 103-110

libs/cypress/support/interceptors/fleets.ts (1)

3-7: Fleet list interceptor correctly wired to API_VERSION

Using API_VERSION in buildFleetResponse keeps the mocked FleetList apiVersion consistent with the rest of the test setup and the fixtures backing single-fleet responses.

proxy/go.mod (1)

7-15: Flightctl backend module bump aligns with v1beta1 migration

The version bump of github.com/flightctl/flightctl looks consistent with the API surface changes in this PR. Please just ensure this version is the one exposing the v1beta1 auth types you’re using here and that go test ./proxy/... passes against it in your environment.

proxy/auth/oidc.go (1)

14-15: OIDC auth handler migrated to v1beta1 types cleanly

The import switch to v1beta1 and the updated getOIDCAuthHandler signature are consistent with how it’s used from auth.go; the rest of the logic (issuer/clientId validation, discovery, client setup) is unchanged, so behavior should remain identical assuming the v1beta1 OIDC types kept the same fields (Issuer, ClientId, Scopes).

Please verify in the flightctl v1beta1 API that AuthProvider.Spec.AsOIDCProviderSpec() returns a struct with the same field names and semantics as before so this function compiles and behaves as expected.

Also applies to: 37-38

proxy/auth/openshift.go (1)

15-17: OpenShift auth handler v1beta1 migration looks consistent

The handler now consuming *v1beta1.AuthProvider and *v1beta1.OpenShiftProviderSpec is wired consistently with the rest of the auth factory logic. URL derivation, clientId checks, scope handling, and OAuth client construction are unchanged, so behavior should match the v1alpha1 version.

Please confirm that the v1beta1 OpenShiftProviderSpec still exposes ClusterControlPlaneUrl, AuthorizationUrl, TokenUrl, ClientId, and Scopes with the same pointer/JSON semantics as before, so this code compiles cleanly and the defaults remain correct.

Also applies to: 37-84

proxy/auth/auth.go (5)

12-13: Core auth config now based on v1beta1.AuthConfig

Switching to v1beta1.AuthConfig in both the import and AuthHandler state aligns with the rest of the v1beta1 migration; the “auth disabled” behavior via nil remains intact.

Please verify the v1beta1 AuthConfig JSON schema for /api/v1/auth/config matches what the backend now returns (providers list, defaultProvider, etc.) so NewAuth and subsequent checks behave as before.

Also applies to: 27-31


54-66: Provider resolution and client_id extraction correctly ported to v1beta1

The helpers now consistently use v1beta1.AuthConfig / v1beta1.AuthProvider and the v1beta1 discriminator/As*ProviderSpec helpers. Provider-type routing (OpenShift, K8s, OIDC, OAuth2, AAP) and client_id extraction semantics are preserved, including the OpenShift ClientId nil/empty checks and explicit errors for AAP/K8s where token exchange isn’t applicable.

Given these functions depend heavily on the generated v1beta1 API surface, please confirm that:

  • AuthProvider.Spec.Discriminator() and the various As*ProviderSpec() helpers exist with the same behavior, and
  • OIDC/OAuth2 specs still expose ClientId as a non-pointer string while OpenShift keeps ClientId as *string,
    so this logic compiles and the error handling paths remain valid.

Also applies to: 70-146, 149-185


273-275: Token exchange & refresh now use v1beta1.TokenRequest and grant-type constants

Both the authorization_code and refresh_token flows are correctly updated to construct v1beta1.TokenRequest instances with the appropriate GrantType enum (AuthorizationCode / RefreshToken) and to route through getClientIdFromProviderConfig for client_id resolution. The surrounding PKCE, cookie, and error handling logic is unchanged.

Please confirm that the v1beta1 TokenRequest type:

  • Uses GrantType, ClientId, Code, CodeVerifier, RedirectUri, and RefreshToken with the expected JSON field names, and
  • Defines AuthorizationCode and RefreshToken constants with the same values previously used,
    so the backend continues to accept these requests without breaking existing auth flows.

Also applies to: 376-382, 417-447


462-471: OAuth error handling updated to v1beta1.TokenResponse pointers

The handler now expects *v1beta1.TokenResponse and safely checks Error / ErrorDescription pointers before constructing the client-facing message, falling back to a generic 500 when no structured error is available. Behavior is consistent with the previous implementation.

Please verify that in v1beta1 TokenResponse.Error and TokenResponse.ErrorDescription are pointer fields (or otherwise nullable) matching this usage, so the nil checks reflect the actual generated Go type.


610-647: Auth config fetch now deserializes into v1beta1.AuthConfig

Fetching /api/v1/auth/config and unmarshalling into v1beta1.AuthConfig preserves the existing behavior, including treating HTTP 418 as “auth disabled” and returning nil. No new edge cases introduced here.

Please ensure the backend now serves a v1beta1-shaped AuthConfig at this endpoint (or that the wire format is backward compatible) so JSON unmarshalling into the new type continues to succeed.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
libs/types/scripts/openapi-typescript.js (1)

19-23: v1beta1 OpenAPI URL looks correct; consider avoiding hard‑coded version string

Pointing swaggerUrl at the v1beta1 spec aligns this generator with the new API version. To reduce churn on the next version bump, consider deriving the version (or full URL) from a shared config/constant used elsewhere in the repo, so this script can’t silently drift from the rest of the tooling.

Please double‑check that the backend repo’s canonical spec path is still api/v1beta1/openapi.yaml before cutting a release.

libs/ui-components/src/constants.ts (1)

2-2: API version constant update is correct; consider cross‑package centralization

Setting API_VERSION to 'v1beta1' here aligns the UI with the new API surface and looks good. If the Nx/workspace boundaries allow, you might later centralize this with the Cypress API_VERSION constant to avoid version drift between UI and e2e tests.

libs/cypress/support/constants.ts (1)

1-1: API_VERSION constant for Cypress support looks good

Defining API_VERSION = 'v1beta1' here is a clean way to coordinate versioning across Cypress fixtures/interceptors.

If libs/ui-components/src/constants.ts also defines an API_VERSION, consider wiring Cypress to import from that single source (or re-exporting it here) to avoid the two values drifting in future.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6bc9d6 and d46b473.

⛔ Files ignored due to path filters (1)
  • proxy/go.sum is excluded by !**/*.sum
📒 Files selected for processing (23)
  • libs/cypress/fixtures/auth/organization.ts (1 hunks)
  • libs/cypress/fixtures/enrollmentRequests/index.ts (5 hunks)
  • libs/cypress/fixtures/fleets/initialFleets.ts (3 hunks)
  • libs/cypress/fixtures/repositories/initialRepositories.ts (1 hunks)
  • libs/cypress/support/constants.ts (1 hunks)
  • libs/cypress/support/interceptors/auth.ts (2 hunks)
  • libs/cypress/support/interceptors/devices.ts (1 hunks)
  • libs/cypress/support/interceptors/enrollmentRequests.ts (1 hunks)
  • libs/cypress/support/interceptors/fleets.ts (1 hunks)
  • libs/cypress/support/interceptors/repositories.ts (1 hunks)
  • libs/types/models/ImageApplicationProviderSpec.ts (1 hunks)
  • libs/types/scripts/openapi-typescript.js (1 hunks)
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts (2 hunks)
  • libs/ui-components/src/constants.ts (1 hunks)
  • proxy/auth/aap.go (2 hunks)
  • proxy/auth/api_client.go (6 hunks)
  • proxy/auth/auth.go (12 hunks)
  • proxy/auth/common.go (2 hunks)
  • proxy/auth/k8s.go (2 hunks)
  • proxy/auth/oauth2.go (2 hunks)
  • proxy/auth/oidc.go (2 hunks)
  • proxy/auth/openshift.go (2 hunks)
  • proxy/go.mod (1 hunks)
🧰 Additional context used
🧠 Learnings (11)
📓 Common learnings
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 371
File: libs/types/models/AppType.ts:10-10
Timestamp: 2025-10-29T16:47:29.614Z
Learning: PR #371 (flightctl/flightctl-ui) adds the AppTypeQuadlet enum member and related types as a preparatory change. Full implementation of quadlet application support in the UI will be added later, after backend support is available.
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 0
File: :0-0
Timestamp: 2025-02-17T08:41:57.993Z
Learning: All files in `libs/types/models` are auto-generated using OpenAPI Generator from the schema defined in https://github.com/flightctl/flightctl/blob/main/api/v1alpha1/openapi.yaml. Changes to these files should be made in the schema instead of modifying the generated files directly.
📚 Learning: 2025-02-18T12:04:42.579Z
Learnt from: rawagner
Repo: flightctl/flightctl-ui PR: 209
File: apps/standalone/src/app/utils/apiCalls.ts:14-16
Timestamp: 2025-02-18T12:04:42.579Z
Learning: In the flightctl-ui codebase, error handling for API calls follows a React pattern where the caller component (e.g., AppToolbar.tsx) implements try-catch blocks and manages error states, rather than handling errors within the API utility functions themselves.

Applied to files:

  • libs/cypress/fixtures/enrollmentRequests/index.ts
📚 Learning: 2025-01-07T10:11:14.375Z
Learnt from: rawagner
Repo: flightctl/flightctl-ui PR: 181
File: proxy/config/ocp.go:16-16
Timestamp: 2025-01-07T10:11:14.375Z
Learning: In the flightctl-ui repository, the `RBACNs` variable used in `proxy/config/ocp.go` is defined in `proxy/config/config.go` as a package-level variable that retrieves its value from the environment variable `K8S_RBAC_NS`.

Applied to files:

  • proxy/auth/aap.go
  • proxy/auth/oidc.go
  • proxy/auth/common.go
  • proxy/auth/oauth2.go
  • proxy/auth/openshift.go
  • proxy/auth/k8s.go
📚 Learning: 2025-11-20T07:33:34.656Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 378
File: libs/ui-components/src/utils/authProvider.ts:5-18
Timestamp: 2025-11-20T07:33:34.656Z
Learning: In the flightctl-ui repository, for AuthProvider objects, the metadata.name field is always present at runtime as it serves as the ID of the authprovider. The OpenAPI schema incorrectly defines it as optional (name?: string in ObjectMeta), but the type assertion `as string` is appropriate when accessing provider.metadata.name since it's guaranteed to exist.

Applied to files:

  • proxy/auth/common.go
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts
📚 Learning: 2025-11-20T09:24:41.991Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 378
File: libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts:288-326
Timestamp: 2025-11-20T09:24:41.991Z
Learning: In the flightctl-ui repository, the CreateAuthProvider form and its utilities (including getAuthProvider in libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts) are specifically designed for CRUD operations on OIDC and OAuth2 authentication providers only. Other provider types (K8s, AAP, OpenShift) are not supported by this form and should be rejected with an error if loading is attempted for editing.

Applied to files:

  • proxy/auth/common.go
  • libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts
  • proxy/auth/k8s.go
📚 Learning: 2025-02-17T08:41:57.993Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 0
File: :0-0
Timestamp: 2025-02-17T08:41:57.993Z
Learning: All files in `libs/types/models` are auto-generated using OpenAPI Generator from the schema defined in https://github.com/flightctl/flightctl/blob/main/api/v1alpha1/openapi.yaml. Changes to these files should be made in the schema instead of modifying the generated files directly.

Applied to files:

  • proxy/auth/oauth2.go
  • libs/types/scripts/openapi-typescript.js
📚 Learning: 2025-03-12T09:09:44.139Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 227
File: libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx:87-87
Timestamp: 2025-03-12T09:09:44.139Z
Learning: The `getUpdatePolicyValues` function in libs/ui-components/src/components/Fleet/CreateFleet/fleetSpecUtils.ts is designed to safely handle undefined values for the updatePolicy parameter.

Applied to files:

  • libs/cypress/fixtures/fleets/initialFleets.ts
📚 Learning: 2025-03-12T09:09:44.139Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 227
File: libs/ui-components/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx:87-87
Timestamp: 2025-03-12T09:09:44.139Z
Learning: The `getUpdatePolicyValues` function in libs/ui-components/src/components/Fleet/CreateFleet/fleetSpecUtils.ts is designed to handle undefined input through its optional parameter definition and consistent use of optional chaining.

Applied to files:

  • libs/cypress/fixtures/fleets/initialFleets.ts
📚 Learning: 2025-10-10T11:35:04.458Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 0
File: :0-0
Timestamp: 2025-10-10T11:35:04.458Z
Learning: In the flightctl-ui repository, TypeScript types are generated using hey-api/openapi-ts and output to a single index.ts file (previously used openapi-typescript-codegen with one file per type under /libs/types/models).

Applied to files:

  • libs/types/scripts/openapi-typescript.js
📚 Learning: 2025-03-20T12:34:33.199Z
Learnt from: celdrake
Repo: flightctl/flightctl-ui PR: 240
File: libs/types/models/FileSpec.ts:8-8
Timestamp: 2025-03-20T12:34:33.199Z
Learning: Files in the types directory are autogenerated from the OpenAPI spec in the flightctl project and should not be directly modified.

Applied to files:

  • libs/types/scripts/openapi-typescript.js
📚 Learning: 2025-03-24T12:33:54.002Z
Learnt from: rawagner
Repo: flightctl/flightctl-ui PR: 209
File: proxy/auth/oidc.go:17-19
Timestamp: 2025-03-24T12:33:54.002Z
Learning: OIDC (OpenID Connect) providers return usernames in the `preferred_username` field, as implemented in the OIDCUserInfo struct in proxy/auth/oidc.go.

Applied to files:

  • proxy/auth/api_client.go
🧬 Code graph analysis (11)
libs/ui-components/src/constants.ts (1)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/cypress/fixtures/enrollmentRequests/index.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/support/interceptors/enrollmentRequests.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/fixtures/repositories/initialRepositories.ts (4)
libs/types/index.ts (1)
  • Repository (153-153)
libs/types/models/Repository.ts (1)
  • Repository (11-23)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/support/interceptors/repositories.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/support/constants.ts (1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
libs/cypress/fixtures/auth/organization.ts (2)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
libs/ui-components/src/constants.ts (1)
  • API_VERSION (6-6)
proxy/auth/api_client.go (5)
libs/types/models/TokenRequest.ts (1)
  • TokenRequest (8-37)
libs/types/index.ts (3)
  • TokenRequest (184-184)
  • TokenResponse (185-185)
  • UserInfoResponse (187-187)
libs/types/models/TokenResponse.ts (1)
  • TokenResponse (8-37)
proxy/auth/auth.go (1)
  • UserInfoResponse (19-21)
proxy/auth/common.go (1)
  • TokenData (40-55)
proxy/auth/openshift.go (3)
proxy/auth/common.go (1)
  • AuthProvider (70-76)
libs/types/index.ts (2)
  • AuthProvider (25-25)
  • OpenShiftProviderSpec (143-143)
libs/types/models/OpenShiftProviderSpec.ts (1)
  • OpenShiftProviderSpec (8-49)
libs/cypress/support/interceptors/fleets.ts (1)
libs/cypress/support/constants.ts (1)
  • API_VERSION (1-1)
proxy/auth/k8s.go (2)
libs/types/models/AuthProvider.ts (1)
  • AuthProvider (10-21)
libs/types/models/K8sProviderSpec.ts (1)
  • K8sProviderSpec (10-33)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: integration-tests
  • GitHub Check: Build ocp plugin
  • GitHub Check: Build
  • GitHub Check: Lint
🔇 Additional comments (20)
libs/types/models/ImageApplicationProviderSpec.ts (1)

10-10: No issues found. This file was properly regenerated from the updated OpenAPI schema.

The v1beta1 OpenAPI schema in the flightctl repository contains the updated documentation "Reference to the OCI image or artifact for the application package," and the generated TypeScript file correctly reflects this schema content. This is the expected workflow—the schema was updated, and the file was regenerated accordingly. No manual edits to auto-generated code are apparent.

proxy/go.mod (1)

8-8: Flightctl module bump aligns with API migration; verify build/tests

Updating github.com/flightctl/flightctl to a newer pseudo‑version is consistent with moving to v1beta1 types. Please confirm the proxy still builds cleanly and the auth/k8s flows pass their tests against this version.

libs/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.ts (1)

28-28: AuthProvider now correctly uses the shared API version constant

Importing API_VERSION and using it for the returned AuthProvider.apiVersion keeps created/updated auth providers in sync with the UI’s configured API version, with no behavioural regressions in the surrounding logic.

Also applies to: 320-320

libs/cypress/fixtures/repositories/initialRepositories.ts (1)

2-2: Repository fixture correctly switched to the shared Cypress API version

Using API_VERSION for apiVersion in the Repository fixture keeps test data aligned with the Cypress‑side version constant and avoids hard‑coded strings.

Also applies to: 6-6

libs/cypress/support/interceptors/auth.ts (1)

2-2: Auth interceptor response now uses centralized API version

Switching the OrganizationList response to apiVersion: API_VERSION keeps the mocked organizations in sync with the Cypress API version constant without altering the response structure.

Also applies to: 22-22

libs/cypress/fixtures/enrollmentRequests/index.ts (1)

2-2: EnrollmentRequest fixtures consistently reference API_VERSION

All EnrollmentRequest fixtures now use the shared API_VERSION constant instead of hard‑coded strings, which keeps test data consistent with the configured API version and simplifies future migrations.

Also applies to: 26-26, 39-39, 52-52, 65-65

libs/cypress/fixtures/fleets/initialFleets.ts (1)

2-2: Fleet fixtures now use the shared API_VERSION constant

Both Fleet fixtures correctly use apiVersion: API_VERSION, and the minor trailing‑comma tweak in devicesSummary is stylistic only and safe.

Also applies to: 6-6, 56-56

libs/cypress/support/interceptors/enrollmentRequests.ts (1)

3-3: EnrollmentRequest interceptors correctly aligned with API_VERSION

Using API_VERSION in buildErResponse keeps all intercepted EnrollmentRequest list responses consistent with the centralized Cypress API version while preserving the existing response shape and routes.

Also applies to: 6-6

libs/cypress/fixtures/auth/organization.ts (1)

1-4: Centralize apiVersion in organization fixture

Using API_VERSION from ../../support/constants looks correct and keeps the fixture aligned with future API version bumps without further edits here.

libs/cypress/support/interceptors/repositories.ts (1)

3-7: Repositories interceptor now aligned with centralized API_VERSION

Importing API_VERSION and wiring it into buildRepositoriesResponse is consistent with the migration and keeps the list wrapper in sync with the current API version.

It’s worth quickly scanning repoList (in libs/cypress/fixtures) to ensure individual Repository objects’ apiVersion fields, if present, were also migrated to API_VERSION so tests don’t mix v1alpha1/v1beta1 in the same payload.

libs/cypress/support/interceptors/devices.ts (1)

2-6: Devices interceptor correctly switched to API_VERSION

Importing API_VERSION and using it in buildDevicesResponse aligns this interceptor with the rest of the suite and keeps the list wrapper consistent with v1beta1.

proxy/auth/oidc.go (1)

14-15: OIDC auth handler migrated cleanly to v1beta1 types

Switching the import to v1beta1 and updating getOIDCAuthHandler to accept *v1beta1.AuthProvider / *v1beta1.OIDCProviderSpec keeps the handler’s behavior intact while aligning it with the new API version.

Also applies to: 37-37

proxy/auth/aap.go (1)

13-15: AAP auth handler now wired to v1beta1 provider/spec

The updated import and getAAPAuthHandler signature correctly move this flow onto v1beta1.AuthProvider and v1beta1.AapProviderSpec without altering behavior.

Also applies to: 53-53

proxy/auth/openshift.go (1)

15-16: OpenShift auth handler signature/import updated to v1beta1

Using v1beta1.AuthProvider and v1beta1.OpenShiftProviderSpec here matches the rest of the auth package’s migration and maintains existing behavior around URL/scopes construction.

Also applies to: 37-37

proxy/auth/k8s.go (1)

13-15: K8s token auth handler moved to v1beta1 without behavior change

The updated import and getK8sAuthHandler signature using *v1beta1.AuthProvider / *v1beta1.K8sProviderSpec align this handler with the new API version while preserving the existing behavior of validating tokens via the FlightCtl API.

Also applies to: 199-213

libs/cypress/support/interceptors/fleets.ts (1)

3-3: LGTM! Centralized API version management.

The import and usage of the API_VERSION constant properly centralizes API version management across the Cypress test suite, making future version updates easier.

Also applies to: 6-6

proxy/auth/oauth2.go (1)

10-10: LGTM! API version migration applied correctly.

The import and function signature have been updated consistently to use v1beta1 types.

Also applies to: 26-26

proxy/auth/common.go (1)

21-21: LGTM! Consistent API version migration.

The import, provider type constants, and function signature have been updated consistently to use v1beta1 types. The provider constants correctly convert v1beta1 enum values to strings.

Also applies to: 27-31, 646-646

proxy/auth/api_client.go (1)

15-15: LGTM! Token API interactions migrated to v1beta1.

All function signatures, type declarations, and API interactions have been consistently updated to use v1beta1 types for TokenRequest, TokenResponse, and UserInfoResponse.

Also applies to: 22-22, 71-71, 88-88, 157-157, 170-170, 194-194

proxy/auth/auth.go (1)

12-12: Code migration to v1beta1 is complete and consistent — no issues found.

Verification confirms:

  • ✓ All remaining v1alpha1 references removed (0 remaining)
  • ✓ All 8 proxy/auth files comprehensively updated to v1beta1 (38 v1beta1 references across auth.go, openshift.go, oidc.go, oauth2.go, k8s.go, common.go, api_client.go, aap.go)
  • All function signatures, field types, imports, and provider config management consistently use v1beta1 types

The flightctl dependency (v1.0.0-main.0.20251125075421-bbc6daa7c2e7) is a development snapshot from the main branch. Backend deployment status and specific breaking changes documentation cannot be verified from the codebase alone—these are operational concerns that should be confirmed by deployment and testing teams.

@celdrake celdrake requested a review from rawagner November 25, 2025 12:11
@celdrake celdrake force-pushed the update-api-to-v1beta1 branch from d46b473 to ad48b93 Compare November 25, 2025 16:57
@celdrake celdrake merged commit d341626 into flightctl:main Nov 26, 2025
6 checks passed
@celdrake celdrake deleted the update-api-to-v1beta1 branch November 26, 2025 08:04
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