Skip to content

[Release-1.0] EDM-2755 show duplicate error in all duplicate files#435

Merged
celdrake merged 1 commit into
flightctl:release-1.0from
celdrake:EDM-2755-show-duplicate-error-in-all-duplicate-files-1.0
Dec 15, 2025
Merged

[Release-1.0] EDM-2755 show duplicate error in all duplicate files#435
celdrake merged 1 commit into
flightctl:release-1.0from
celdrake:EDM-2755-show-duplicate-error-in-all-duplicate-files-1.0

Conversation

@celdrake

@celdrake celdrake commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

Backport of #428

Summary by CodeRabbit

Release Notes

  • New Features

    • Added token introspection support for GitHub, JWT, and RFC7662 standards
    • Introduced start grace duration configuration for device update schedules
    • OAuth2 providers now restricted to YAML editor modifications
  • Improvements

    • Enhanced error messaging in organization selection flow
    • Streamlined volume configuration UI with simplified controls
    • Improved terminal container layout and height rendering
    • Strengthened authentication state management and security
  • Bug Fixes

    • Fixed enrollment request approval authorization checks
    • Resolved organization selector error display issues

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

@celdrake celdrake changed the base branch from main to release-1.0 December 15, 2025 12:38
@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown

Caution

Review failed

Failed to post review comments

Walkthrough

This PR consolidates authentication flows by unifying token handling into a single field, refactors device/application volume management by removing type-based branching, renames organization context properties for clarity, adds OAuth2 introspection type definitions, introduces grace duration fields for update scheduling, and enforces YAML-only editing for OAuth2 providers.

Changes

Cohort / File(s) Summary
Organization selector context refactoring
apps/ocp-plugin/src/components/common/WithPageLayout.tsx, apps/standalone/src/app/components/AppLayout/AppLayout.tsx, libs/ui-components/src/components/common/OrganizationGuard.tsx, libs/ui-components/src/components/common/OrganizationSelector.tsx
Renames context property isOrganizationSelectionRequired to mustShowOrganizationSelector with updated selection logic to account for errors; adds error alert rendering in selector.
Auth token data structure consolidation
proxy/auth/common.go, proxy/auth/api_client.go, proxy/auth/auth.go, proxy/auth/k8s.go, proxy/middleware/auth.go
Replaces separate IDToken and AccessToken fields with single Token field in TokenData struct; updates token access from getter method to direct field; refactors token selection logic based on provider type.
OAuth/OIDC auth handler simplification
proxy/auth/aap.go, proxy/auth/oauth2.go, proxy/auth/oidc.go, proxy/auth/openshift.go, proxy/auth/k8s.go
Removes public methods GetToken, GetUserInfo, and RefreshToken from all auth handlers; updates GetLoginRedirectURL signature to accept state parameter instead of providerName.
Auth flow refactoring with state and PKCE
proxy/auth/auth.go, proxy/auth/common.go, apps/standalone/src/app/context/AuthContext.ts
Introduces state cookie lifecycle and state-based provider association; adds token-based login flow support; removes provider extraction from callback state in client code.
Volume management simplification
libs/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts, libs/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.tsx, libs/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.tsx, libs/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx, libs/ui-components/src/types/deviceSpec.ts
Removes VolumeType enum and related branching; simplifies to direct imageRef/mountPath presence checks; adds default ImagePullPolicy.PullIfNotPresent when image present.
Update policy grace duration fields
libs/types/models/UpdateSchedule.ts, libs/ui-components/src/types/deviceSpec.ts, libs/ui-components/src/components/Fleet/CreateFleet/fleetSpecUtils.ts, libs/ui-components/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.tsx, libs/ui-components/src/utils/patch.ts, libs/ui-components/src/utils/time.ts
Changes UpdateSchedule.startGraceDuration from optional to required; adds downloadStartGraceDuration and installStartGraceDuration form fields; removes getStartGraceDuration helper function.
Validation schema refactoring for volumes and durations
libs/ui-components/src/components/form/validations.ts
Introduces reusable volume schemas (singleContainerVolumesSchema, composeQuadletVolumesSchema) and removes VolumeType-driven validation; adds grace duration validation with DURATION_REGEXP.
OAuth2 introspection type exports
libs/types/index.ts, libs/types/models/GitHubIntrospectionSpec.ts, libs/types/models/JwtIntrospectionSpec.ts, libs/types/models/Rfc7662IntrospectionSpec.ts, libs/types/models/OAuth2Introspection.ts, libs/types/models/OAuth2ProviderSpec.ts
Adds four new introspection type definitions (GitHub, JWT, RFC7662) and exports them; creates union type OAuth2Introspection and adds optional introspection property to OAuth2ProviderSpec.
Auth provider UI edit restrictions
libs/ui-components/src/components/AuthProvider/AuthProviderDetails/AuthProviderDetails.tsx, libs/ui-components/src/components/AuthProvider/AuthProviderRow.tsx, libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProvider.tsx
Disables Edit action for OAuth2 providers with tooltip; shows not-allowed alert when attempting to edit OAuth2 providers.
Terminal and component layout styling
libs/ui-components/src/components/Terminal/Terminal.tsx, libs/ui-components/src/components/Terminal/Terminal.css, libs/ui-components/src/components/Device/DeviceDetails/TerminalTab.tsx
Adds CSS classes for container layout; introduces dynamic height calculation via ResizeObserver and window resize listener in terminal tab.
WebSocket lifecycle safety
libs/ui-components/src/hooks/useWebSocket.ts
Introduces isMountedRef to guard all state updates and effects against post-unmount operations.
Auth provider and example text updates
libs/ui-components/src/components/AuthProvider/CreateAuthProvider/AuthProviderHelperText.tsx, libs/ui-components/src/components/AuthProvider/CreateAuthProvider/CreateAuthProviderForm.tsx, libs/ui-components/src/components/AuthProvider/CreateAuthProvider/RoleAssignmentSection.tsx
Updates example from org1:admin to org1:flightctl-admin; changes role codes to flightctl-prefixed versions; removes inline role label edit capability; reorganizes form sections with dividers.
Enrollment permission and update policy validation
libs/ui-components/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx, libs/ui-components/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.tsx
Changes enrollment approval permission from POST to UPDATE; refactors update policy validation to be conditional on useBasicUpdateConfig flag.
API URL and SSRF protection utilities
proxy/common/validation.go, proxy/bridge/common.go, proxy/bridge/terminal.go, proxy/bridge/testauth.go
Adds BuildFctlApiUrl and IsSafeResourceName validation helpers; introduces sanitizeQueryForSSRF and makeSafeHTTPRequest; centralizes URL construction with scheme and path validation.
Translation additions
libs/i18n/locales/en/translation.json
Adds translations for OAuth2/OIDC providers, volume mount paths, pull policies, grace duration fields, and error/login flow messages.
Dependency and documentation updates
package.json, libs/ui-components/src/hooks/useAppLinks.ts
Adds node-forge override; updates ACM version to 2.14 and flightctl documentation base URLs.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Auth handler refactoring (proxy/auth/*.go): Widespread changes to token handling, state management, and method removal across five handler types; requires careful validation of token selection logic and state-cookie lifecycle.
  • Volume validation schema rewrite (libs/ui-components/src/components/form/validations.ts): New schema composition and removal of VolumeType branching; impacts multiple form paths.
  • OAuth2 provider edit restrictions: Involves multiple UI files with new conditional logic and permission changes across different modules.
  • Update policy grace duration propagation: Changes touch form definitions, validation, utilities, and type models; requires tracing field flow through form submission.
  • SSRF and URL safety refactoring (proxy/bridge/*, proxy/common/validation.go): New centralized helpers with error handling paths that must be validated across multiple call sites.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title focuses on showing duplicate errors in all duplicate files, but the actual changeset encompasses far more comprehensive changes including auth provider modifications, OAuth2 introspection types, volume handling refactoring, terminal improvements, and various other features unrelated to the stated objective. Update the title to reflect the full scope of changes, such as 'refactor: major updates to auth providers, volume handling, OAuth2 introspection, and terminal components' or provide a more accurate title that represents the primary change.
Docstring Coverage ⚠️ Warning Docstring coverage is 73.53% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@celdrake celdrake merged commit 69f215a into flightctl:release-1.0 Dec 15, 2025
6 checks passed
@celdrake celdrake deleted the EDM-2755-show-duplicate-error-in-all-duplicate-files-1.0 branch December 15, 2025 13:21
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.

1 participant