Skip to content

Conversation

cammiida
Copy link
Contributor

@cammiida cammiida commented Aug 27, 2025

Description

Related Issue(s)

  • closes #{issue number}

Verification/QA

  • Manual functionality testing
    • I have tested these changes manually
    • Creator of the original issue (or service owner) has been contacted for manual testing (or will be contacted when released in alpha)
    • No testing done/necessary
  • Automated tests
    • Unit test(s) have been added/updated
    • Cypress E2E test(s) have been added/updated
    • No automatic tests are needed here (no functional changes/additions)
    • I want someone to help me make some tests
  • UU/WCAG (follow these guidelines until we have our own)
    • I have tested with a screen reader/keyboard navigation/automated wcag validator
    • No testing done/necessary (no DOM/visual changes)
    • I want someone to help me perform accessibility testing
  • User documentation @ altinn-studio-docs
    • Has been added/updated
    • No functionality has been changed/added, so no documentation is needed
    • I will do that later/have created an issue
  • Support in Altinn Studio
    • Issue(s) created for support in Studio
    • This change/feature does not require any changes to Altinn Studio
  • Sprint board
    • The original issue (or this PR itself) has been added to the Team Apps project and to the current sprint board
    • I don't have permissions to do that, please help me out
  • Labels
    • I have added a kind/* and backport* label to this PR for proper release notes grouping
    • I don't have permissions to add labels, please help me out

Summary by CodeRabbit

  • Refactor
    • Centralized version/capability checks across attachments, validation, language fetching, process navigation and PDF preview for consistent behavior.
  • Bug Fixes
    • Corrected PDF preview error wording and made required-version messages more consistent.
    • More predictable language-fetching behavior for anonymous users.
  • Chores
    • Added a shared version map and cleaned up legacy version-checking logic.

Copy link

coderabbitai bot commented Aug 27, 2025

📝 Walkthrough

Walkthrough

Centralizes version-based feature checks into a new module src/utils/versioning/versions.ts, replaces multiple in-file/old helpers with its exports across features, removes obsolete helper functions, changes callers to pass altinnNugetVersion (string), updates imports and one test import, and fixes a PDF preview message.

Changes

Cohort / File(s) Change summary
New centralized versioning module
src/utils/versioning/versions.ts
Added FEATURE_VERSION_MAP, MINIMUM_APPLICATION_VERSION_NAME, and feature-check helpers (isMinimumApplicationVersion, appSupportsPdfPreviewButton, appSupportsFetchAppLanguagesInAnonymous, appSupportsUnlockingOnProcessNextFailure, appSupportsNewAttachmentAPI, appSupportsIncrementalValidationFeatures) implemented via isAtLeastVersion.
Application metadata provider
src/features/applicationMetadata/ApplicationMetadataProvider.tsx
Replaced two-step/inline version check with isMinimumApplicationVersion(data.altinnNugetVersion) and updated imports.
Version error / children gating
src/features/applicationMetadata/VersionErrorOrChildren.tsx
Replaced import of MINIMUM_APPLICATION_VERSION with MINIMUM_APPLICATION_VERSION_NAME from versioning and use that symbol when rendering the min-version in language params.
Attachments: centralize check & remove old helper
src/features/attachments/AttachmentsStorePlugin.tsx, src/features/attachments/tools.ts
AttachmentsStorePlugin now imports appSupportsNewAttachmentAPI from versioning and passes applicationMetadata.altinnNugetVersion (string). Removed the old exported appSupportsNewAttachmentAPI from src/features/attachments/tools.ts.
Process/next & unlocking behavior
src/features/instance/useProcessNext.tsx
Replaced local/inline version checks with appSupportsIncrementalValidationFeatures and appSupportsUnlockingOnProcessNextFailure from versioning; added const altinnNugetVersion = useApplicationMetadata().altinnNugetVersion and pass that string to checks; removed local unlocking helper and adjusted boolean handling in error paths.
Language fetching gating
src/features/language/LanguageProvider.tsx
Replaced inline isAtLeastVersion boolean with appSupportsFetchAppLanguagesInAnonymous(altinnNugetVersion); updated imports to versioning module and call pattern.
Backend validation: migrate checks & remove old helper
src/features/validation/backendValidation/backendValidationQuery.ts, src/features/validation/backendValidation/backendValidationUtils.ts
Query now imports appSupportsIncrementalValidationFeatures from versioning and passes altinnNugetVersion; removed the old exported appSupportsIncrementalValidationFeatures from backendValidationUtils.ts.
PDF preview gating and messaging
src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx
Replaced isAtLeastVersion comparison with appSupportsPdfPreviewButton(applicationMetadata.altinnNugetVersion); use FEATURE_VERSION_MAP.PDF_PREVIEW_BUTTON for displayed version label; fixed error text wording.
Version compare test import
src/utils/versioning/versionCompare.test.ts
Updated isAtLeastVersion import path to src/utils/versioning/versionCompare; test content unchanged.
Removed min-version constant module
src/features/applicationMetadata/minVersion.ts
Deleted exported MINIMUM_APPLICATION_VERSION constant (build/name object).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~30 minutes

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/versioning-cleanup

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@cammiida cammiida force-pushed the chore/versioning-cleanup branch from afb7716 to fb47c1b Compare August 27, 2025 12:05
@cammiida cammiida added kind/other Pull requests containing chores/repo structure/other changes backport-ignore This PR is a new feature and should not be cherry-picked onto release branches labels Aug 27, 2025
@cammiida cammiida removed this from Team Apps Aug 27, 2025
@cammiida cammiida moved this to 🔎 In review in Team Altinn Studio Aug 27, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
src/features/applicationMetadata/VersionErrorOrChildren.tsx (1)

23-23: Avoid hard-coding the minimum backend version string. Source it from the central versioning module.

Hard-coding 'v8.0.0' risks drift when minimum version changes. Pull a label from versions.ts instead.

Apply in this file:

+import { minimumApplicationVersionLabel } from 'src/utils/versioning/versions';
@@
-            params={['v8.0.0']}
+            params={[minimumApplicationVersionLabel()]}

And add this helper in src/utils/versioning/versions.ts (or equivalent), keeping label formatting consistent:

export function minimumApplicationVersionLabel(): string {
  // Adjust if your map stores a prefixed value
  const ver = FEATURE_VERSION_MAP.MINIMUM_APPLICATION_VERSION;
  return ver.startsWith('v') ? ver : `v${ver}`;
}

I can wire this up if you prefer.

src/features/validation/backendValidation/backendValidationQuery.ts (1)

16-16: Centralized feature-gate usage looks good; minor readability nit.

Deconstruct altinnNugetVersion before use to avoid nesting a hook call inside the argument list.

-import { appSupportsIncrementalValidationFeatures } from 'src/utils/versioning/versions';
+import { appSupportsIncrementalValidationFeatures } from 'src/utils/versioning/versions';
@@
-  const hasIncrementalValidationFeatures = appSupportsIncrementalValidationFeatures(
-    useApplicationMetadata().altinnNugetVersion,
-  );
+  const { altinnNugetVersion } = useApplicationMetadata();
+  const hasIncrementalValidationFeatures = appSupportsIncrementalValidationFeatures(altinnNugetVersion);

Also applies to: 135-137

src/utils/versioning/versions.ts (1)

14-26: Consider introducing an “unknown” state instead of defaulting to false for undefined versions

We verified that every altinnNugetVersion value in tests, mocks and e2e (e.g. ‘8.5.0.157’, ‘8.5.0.141’, ‘8.0.0.0’, ‘8.1.0.115’) and all entries in FEATURE_VERSION_MAP use a consistent four‐segment format, so isAtLeastVersion will always compare like–for–like. However, when currentNugetVersion is undefined, isFeatureSupported unconditionally returns false, causing call sites (e.g. PDFPreviewButtonComponent.tsx, useProcessNext.tsx) to treat “unknown” as “unsupported” and potentially surface errors or hide features prematurely.

To refine this behavior, you can:
• Change isFeatureSupported (src/utils/versioning/versions.ts) to return boolean | undefined—where undefined means “version unknown”—and update the typed feature‐support helpers accordingly.
• In each consumer (e.g. appSupportsPdfPreviewButton, appSupportsUnlockingOnProcessNextFailure), use strict checks (=== false) to trigger unsupported flows and treat undefined as “neutral” (no UI change).
• If you’d rather keep the helpers boolean‐only, audit all call sites and guard on currentNugetVersion before invoking support checks, ensuring you never display an “unsupported” message when version metadata is simply missing.

This refactor is optional but will prevent unintended UI errors when version metadata isn’t yet available.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between a18a687 and fb47c1b.

📒 Files selected for processing (11)
  • src/features/applicationMetadata/ApplicationMetadataProvider.tsx (2 hunks)
  • src/features/applicationMetadata/VersionErrorOrChildren.tsx (1 hunks)
  • src/features/attachments/AttachmentsStorePlugin.tsx (3 hunks)
  • src/features/attachments/tools.ts (0 hunks)
  • src/features/instance/useProcessNext.tsx (5 hunks)
  • src/features/language/LanguageProvider.tsx (2 hunks)
  • src/features/validation/backendValidation/backendValidationQuery.ts (2 hunks)
  • src/features/validation/backendValidation/backendValidationUtils.ts (0 hunks)
  • src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx (2 hunks)
  • src/utils/versioning/versionCompare.test.ts (1 hunks)
  • src/utils/versioning/versions.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • src/features/validation/backendValidation/backendValidationUtils.ts
  • src/features/attachments/tools.ts
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Avoid using any and unnecessary type casts (as Type) in TypeScript; prefer precise typings and refactor existing casts/anys
For TanStack Query, use objects to manage query keys and functions, and centralize shared options via queryOptions

Files:

  • src/features/validation/backendValidation/backendValidationQuery.ts
  • src/features/applicationMetadata/VersionErrorOrChildren.tsx
  • src/features/applicationMetadata/ApplicationMetadataProvider.tsx
  • src/utils/versioning/versionCompare.test.ts
  • src/utils/versioning/versions.ts
  • src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx
  • src/features/language/LanguageProvider.tsx
  • src/features/attachments/AttachmentsStorePlugin.tsx
  • src/features/instance/useProcessNext.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

In tests, use renderWithProviders from src/test/renderWithProviders.tsx to supply required form layout context

Files:

  • src/utils/versioning/versionCompare.test.ts
🧬 Code graph analysis (7)
src/features/validation/backendValidation/backendValidationQuery.ts (2)
src/utils/versioning/versions.ts (1)
  • appSupportsIncrementalValidationFeatures (61-63)
src/features/applicationMetadata/ApplicationMetadataProvider.tsx (1)
  • useApplicationMetadata (67-67)
src/features/applicationMetadata/ApplicationMetadataProvider.tsx (1)
src/utils/versioning/versions.ts (1)
  • isMinimumApplicationVersion (28-30)
src/utils/versioning/versions.ts (1)
src/utils/versioning/versionCompare.ts (1)
  • isAtLeastVersion (13-32)
src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx (4)
src/layout/layout.ts (1)
  • NodeValidationProps (99-102)
src/features/instance/InstanceContext.tsx (1)
  • useStrictInstanceId (75-82)
src/features/applicationMetadata/ApplicationMetadataProvider.tsx (1)
  • useApplicationMetadata (67-67)
src/utils/versioning/versions.ts (2)
  • appSupportsPdfPreviewButton (32-34)
  • FEATURE_VERSION_MAP (3-10)
src/features/language/LanguageProvider.tsx (1)
src/utils/versioning/versions.ts (1)
  • appSupportsFetchAppLanguagesInAnonymous (36-38)
src/features/attachments/AttachmentsStorePlugin.tsx (1)
src/utils/versioning/versions.ts (1)
  • appSupportsNewAttachmentAPI (44-46)
src/features/instance/useProcessNext.tsx (2)
src/features/applicationMetadata/ApplicationMetadataProvider.tsx (1)
  • useApplicationMetadata (67-67)
src/utils/versioning/versions.ts (2)
  • appSupportsUnlockingOnProcessNextFailure (40-42)
  • appSupportsIncrementalValidationFeatures (61-63)
⏰ 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: Cypress Run Internal (4)
  • GitHub Check: Cypress Run Internal (2)
  • GitHub Check: check-label
  • GitHub Check: Type-checks, eslint, unit tests and SonarCloud
🔇 Additional comments (11)
src/utils/versioning/versionCompare.test.ts (1)

1-1: Import path migration verified – no old imports remain

Ran searches across .ts/.tsx files and confirmed there are no imports from src/utils/versionCompare. All instances reference the new path src/utils/versioning/versionCompare in:

  • src/utils/versioning/versions.ts
  • src/utils/versioning/versionCompare.test.ts

No further changes needed.

src/features/applicationMetadata/ApplicationMetadataProvider.tsx (1)

13-13: No stale versioning imports detected – changes approved

Ran the scan for any remaining imports of MINIMUM_APPLICATION_VERSION or isAtLeastVersion across all .ts and .tsx files and found only their original definitions in:

  • src/utils/versioning/versions.ts
  • src/features/applicationMetadata/minVersion.ts

There are no external consumers still importing from the old locations. All usage now goes through isMinimumApplicationVersion.

src/features/attachments/AttachmentsStorePlugin.tsx (1)

31-31: No remaining imports of appSupportsNewAttachmentAPI

Verified via rg -nC1 "appSupportsNewAttachmentAPI" --glob "*.ts" --glob "*.tsx" that the only occurrences are:

  • src/utils/versioning/versions.ts (definition)
  • src/features/attachments/AttachmentsStorePlugin.tsx (import at line 31)

No other modules import appSupportsNewAttachmentAPI from any old location.

src/features/language/LanguageProvider.tsx (2)

10-10: Good move: centralized feature gate import

Switching to appSupportsFetchAppLanguagesInAnonymous consolidates version checks and improves consistency.


96-96: Confirm semantics of userIsAuthenticated

This relies on useIsAllowAnonymous(false). If that hook returns “allow anonymous” rather than “is authenticated”, the variable name could mislead and the OR-condition might behave opposite of intent. Please confirm.

src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx (1)

10-10: Import change aligns with new versioning module

Using appSupportsPdfPreviewButton and FEATURE_VERSION_MAP is consistent with PR objectives.

src/utils/versioning/versions.ts (1)

3-10: Feature map looks solid and typed

Constants are frozen with as const; keys align with usages across the PR.

src/features/instance/useProcessNext.tsx (4)

19-22: Centralized version gates: good refactor

Using the shared versions helpers improves cohesion and reduces duplication.


48-48: LGTM: derive altinnNugetVersion once

Clear and avoids passing full metadata around.


78-81: Unlock-on-failure check used correctly here

Conditionally swallowing the 500 PDF generation error when supported is correct.


104-104: Correct inversion for incremental validation feature

Passing !appSupportsIncrementalValidationFeatures(...) to toggle legacy behavior is correct.

@cammiida cammiida force-pushed the chore/versioning-cleanup branch from fb47c1b to c88f1f4 Compare August 27, 2025 12:37
Copy link

@coderabbitai coderabbitai bot left a comment

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 (1)
src/features/applicationMetadata/VersionErrorOrChildren.tsx (1)

22-24: Double-check whether the 'v' prefix is part of the translation

If the i18n string already includes the 'v' prefix, passing 'v8.0.0' (or a name that includes 'v') can yield "vv8.0.0". Prefer passing the raw semantic version (e.g., 8.0.0) and letting the translation format it.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fb47c1b and c88f1f4.

📒 Files selected for processing (11)
  • src/features/applicationMetadata/ApplicationMetadataProvider.tsx (2 hunks)
  • src/features/applicationMetadata/VersionErrorOrChildren.tsx (1 hunks)
  • src/features/attachments/AttachmentsStorePlugin.tsx (3 hunks)
  • src/features/attachments/tools.ts (0 hunks)
  • src/features/instance/useProcessNext.tsx (5 hunks)
  • src/features/language/LanguageProvider.tsx (2 hunks)
  • src/features/validation/backendValidation/backendValidationQuery.ts (2 hunks)
  • src/features/validation/backendValidation/backendValidationUtils.ts (0 hunks)
  • src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx (2 hunks)
  • src/utils/versioning/versionCompare.test.ts (1 hunks)
  • src/utils/versioning/versions.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • src/features/attachments/tools.ts
  • src/features/validation/backendValidation/backendValidationUtils.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/utils/versioning/versionCompare.test.ts
  • src/features/validation/backendValidation/backendValidationQuery.ts
  • src/utils/versioning/versions.ts
  • src/features/applicationMetadata/ApplicationMetadataProvider.tsx
  • src/features/attachments/AttachmentsStorePlugin.tsx
  • src/features/instance/useProcessNext.tsx
  • src/features/language/LanguageProvider.tsx
  • src/layout/PDFPreviewButton/PDFPreviewButtonComponent.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Avoid using any and unnecessary type casts (as Type) in TypeScript; prefer precise typings and refactor existing casts/anys
For TanStack Query, use objects to manage query keys and functions, and centralize shared options via queryOptions

Files:

  • src/features/applicationMetadata/VersionErrorOrChildren.tsx
⏰ 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). (3)
  • GitHub Check: Type-checks, eslint, unit tests and SonarCloud
  • GitHub Check: Install
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (1)
src/features/applicationMetadata/VersionErrorOrChildren.tsx (1)

22-24: Confirm and replace hard-coded version

I wasn’t able to automatically verify the presence of MINIMUM_APPLICATION_VERSION in your versioning module, so please double‐check and swap out the literal string once confirmed.

• Ensure that src/utils/versioning/versions.ts exports a MINIMUM_APPLICATION_VERSION constant (for example:

export const MINIMUM_APPLICATION_VERSION = { name: 'v8.0.0', /* … */ }
```)  
• Replace the hard‐coded `'v8.0.0'` in `src/features/applicationMetadata/VersionErrorOrChildren.tsx` with the imported constant:  
```diff
-          <Lang
-            id="version_error.min_backend_version"
-            params={["v8.0.0"]}
-          />
+          <Lang
+            id="version_error.min_backend_version"
+            params={[MINIMUM_APPLICATION_VERSION.name]}
+          />

• Add the import alongside your other module imports:

import { MINIMUM_APPLICATION_VERSION } from "src/utils/versioning/versions";

Copy link
Contributor

@HauklandJ HauklandJ left a comment

Choose a reason for hiding this comment

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

Nice!

src/features/applicationMetadata/minVersion.ts brukes vel ikke lenger?

@cammiida cammiida self-assigned this Aug 27, 2025
@cammiida cammiida requested a review from HauklandJ August 27, 2025 15:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/utils/versioning/versions.ts (1)

3-11: Centralization looks good; enforce 4-part version typing and de-drift the min app version.

Tie the display name and NuGet threshold together and statically validate version shape to avoid future drift and typos.

Apply:

-export const MINIMUM_APPLICATION_VERSION_NAME = 'v8.0.0';
-export const FEATURE_VERSION_MAP = {
-  MINIMUM_APPLICATION_VERSION: '8.0.0.108',
+export type FourPartVersion = `${number}.${number}.${number}.${number}`;
+export const MINIMUM_APPLICATION_VERSION_NAME = 'v8.0.0';
+export const MINIMUM_APPLICATION_VERSION_NUGET: FourPartVersion = '8.0.0.108';
+export const FEATURE_VERSION_MAP = {
+  MINIMUM_APPLICATION_VERSION: MINIMUM_APPLICATION_VERSION_NUGET,
   UNLOCKING_ON_PROCESS_NEXT_FAILURE: '8.1.0.115',
   INCREMENTAL_VALIDATION: '8.5.0.141',
   NEW_ATTACHMENTS_API: '8.5.0.153',
   PDF_PREVIEW_BUTTON: '8.5.0.157',
   APP_LANGUAGES_IN_ANONYMOUS: '8.5.6.180',
-} as const;
+} as const satisfies Record<string, FourPartVersion>;

Note: If TS < 4.9, drop the satisfies clause but keep FourPartVersion and MINIMUM_APPLICATION_VERSION_NUGET.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c88f1f4 and 105403b.

📒 Files selected for processing (3)
  • src/features/applicationMetadata/VersionErrorOrChildren.tsx (2 hunks)
  • src/features/applicationMetadata/minVersion.ts (0 hunks)
  • src/utils/versioning/versions.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/features/applicationMetadata/minVersion.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/features/applicationMetadata/VersionErrorOrChildren.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Avoid using any and unnecessary type casts (as Type) in TypeScript; prefer precise typings and refactor existing casts/anys
For TanStack Query, use objects to manage query keys and functions, and centralize shared options via queryOptions

Files:

  • src/utils/versioning/versions.ts
🧬 Code graph analysis (1)
src/utils/versioning/versions.ts (1)
src/utils/versioning/versionCompare.ts (1)
  • isAtLeastVersion (13-32)
⏰ 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). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Install
  • GitHub Check: Type-checks, eslint, unit tests and SonarCloud
🔇 Additional comments (1)
src/utils/versioning/versions.ts (1)

29-47: Wrappers read clean and keep callers honest.

Nice thin delegates to the centralized checker; names are self-explanatory.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
6 Security Hotspots

See analysis details on SonarQube Cloud

@cammiida
Copy link
Contributor Author

cammiida commented Sep 1, 2025

Cypress-testen som feiler feiler i main også, så ingenting som er introdusert her. Merger denne og ser på å få fikset testen separat.

@cammiida cammiida merged commit a0bb9b4 into main Sep 1, 2025
13 of 16 checks passed
@cammiida cammiida deleted the chore/versioning-cleanup branch September 1, 2025 11:18
@github-project-automation github-project-automation bot moved this from 🔎 In review to ✅ Done in Team Altinn Studio Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-ignore This PR is a new feature and should not be cherry-picked onto release branches kind/other Pull requests containing chores/repo structure/other changes
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants