Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Remove feature flag accesspackages #14388

Merged
merged 11 commits into from
Jan 17, 2025
Merged

Conversation

mgunnerud
Copy link
Contributor

@mgunnerud mgunnerud commented Jan 9, 2025

Description

  • Remove the feature flag accessPackages to release access package selection in policy editor for apps and resources

Related Issue(s)

  • this PR

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Summary by CodeRabbit

  • New Features

    • Unconditional rendering of Access Packages component.
    • Added a new warning component for Access Packages.
  • Refactor

    • Simplified import statements for Access Packages components.
    • Removed AccessPackages feature flag.
  • Bug Fixes

    • Ensured empty array is used when access packages data is undefined.
  • Documentation

    • Updated warning messages related to access packages for clarity and guidance.

@github-actions github-actions bot added solution/studio/designer Issues related to the Altinn Studio Designer solution. area/authorization Area: Issues related to roles and rights on apps, such as who can instantiate, sign etc. frontend labels Jan 9, 2025
Copy link

codecov bot commented Jan 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.65%. Comparing base (5c1b2b9) to head (a4c50e4).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #14388   +/-   ##
=======================================
  Coverage   95.65%   95.65%           
=======================================
  Files        1886     1889    +3     
  Lines       24546    24554    +8     
  Branches     2817     2817           
=======================================
+ Hits        23479    23488    +9     
  Misses        805      805           
+ Partials      262      261    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mgunnerud mgunnerud marked this pull request as ready for review January 9, 2025 15:15
Copy link
Contributor

coderabbitai bot commented Jan 13, 2025

📝 Walkthrough

Walkthrough

The pull request introduces changes to the policy editor and feature toggle utilities in the frontend package. Modifications include simplifying import statements, removing conditional rendering of the PolicyAccessPackages component, and implementing a fallback mechanism for access packages. The AccessPackages feature flag has been removed from the FeatureFlag enum, indicating a shift in how access packages are managed within the application. Additionally, new warning messages and a warning component related to access packages have been added to enhance user guidance.

Changes

File Change Summary
frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackages.tsx Simplified import statements; introduced new component PolicyAccessPackagesWarning
frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyRule.tsx Removed conditional rendering of PolicyAccessPackages component, now always rendering
frontend/packages/policy-editor/src/utils/index.ts Added fallback mechanism for accessPackages, assigning an empty array if undefined
frontend/packages/shared/src/utils/featureToggleUtils.ts Removed AccessPackages entry from FeatureFlag enum
frontend/language/src/nb.json Updated warning messages related to access packages; modified keys for improved clarity

Possibly related PRs

Suggested labels

area/process, skip-releasenotes, skip-documentation

Suggested reviewers

  • wrt95
  • nkylstad
  • ErlingHauan

📜 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 15ffff4 and a4c50e4.

📒 Files selected for processing (2)
  • frontend/language/src/nb.json (1 hunks)
  • frontend/packages/shared/src/utils/featureToggleUtils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • frontend/packages/shared/src/utils/featureToggleUtils.ts
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Build environment and run e2e test
  • GitHub Check: Testing
  • GitHub Check: CodeQL
  • GitHub Check: Typechecking and linting
🔇 Additional comments (1)
frontend/language/src/nb.json (1)

634-640: Well-structured warning messages for the access package transition!

The warning messages effectively communicate the transition from Altinn roles to access packages:

  • Clear timeline for the phase-out
  • Actionable guidance for users
  • Well-organized information with main warning and additional notes
  • Proper use of HTML placeholders for dynamic content

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

Copy link
Contributor

@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)
frontend/packages/policy-editor/src/utils/index.ts (1)

67-67: LGTM! Added null safety for access packages.

The fallback to an empty array ensures type safety and consistent behavior when access packages are undefined.

Consider adding a type guard or assertion to make the null check more explicit:

-      accessPackages: r.accessPackages || [],
+      accessPackages: Array.isArray(r.accessPackages) ? r.accessPackages : [],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aa46b72 and de97e82.

📒 Files selected for processing (4)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackages.tsx (1 hunks)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyRule.tsx (1 hunks)
  • frontend/packages/policy-editor/src/utils/index.ts (1 hunks)
  • frontend/packages/shared/src/utils/featureToggleUtils.ts (0 hunks)
💤 Files with no reviewable changes (1)
  • frontend/packages/shared/src/utils/featureToggleUtils.ts
✅ Files skipped from review due to trivial changes (1)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackages.tsx
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build environment and run e2e test
🔇 Additional comments (1)
frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyRule.tsx (1)

87-87: LGTM! Removal of feature flag for access packages.

The unconditional rendering of PolicyAccessPackages aligns with the PR objective to enable access package selection in the policy editor.

Let's verify that the component is properly integrated with its dependencies:

✅ Verification successful

Component integration verified successfully

The PolicyAccessPackages component shows proper integration with its dependencies, including comprehensive test coverage and clean architecture.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify PolicyAccessPackages component integration
# Check for any potential circular dependencies or missing imports
rg -l "PolicyAccessPackages" frontend/packages/policy-editor/src/

Length of output: 2395

Copy link
Member

@nkylstad nkylstad left a comment

Choose a reason for hiding this comment

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

LGTM 🥇

Copy link
Member

@nkylstad nkylstad left a comment

Choose a reason for hiding this comment

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

One aspect I did not consider is whether the apps are now ready to support the access packages 🤔 Will investigate and get back to you!

Copy link
Contributor

@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)
frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackagesWarning.tsx (1)

11-44: Consider removing the empty string placeholder in the StudioLink.

The component implementation looks good overall. However, there's an empty string placeholder ({''}) within the StudioLink component that could be removed since it doesn't serve any purpose.

-            {''}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between de97e82 and 15ffff4.

📒 Files selected for processing (3)
  • frontend/language/src/nb.json (1 hunks)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackages.tsx (3 hunks)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackagesWarning.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackages.tsx
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build environment and run e2e test
  • GitHub Check: CodeQL
  • GitHub Check: Testing
🔇 Additional comments (2)
frontend/packages/policy-editor/src/components/PolicyCardRules/PolicyRule/PolicyAccessPackages/PolicyAccessPackagesWarning.tsx (1)

1-9: LGTM! Clean and well-organized imports.

The imports are properly structured using named imports and grouped logically.

frontend/language/src/nb.json (1)

630-636: LGTM! Translations are clear and consistent.

The translations effectively communicate:

  • The transition from Altinn roles to access packages
  • Timeline for the change (spring 2025)
  • Important limitations and guidance for users
  • Clear instructions for role selection

The translations align well with their usage in the PolicyAccessPackagesWarning component.

@mgunnerud mgunnerud added the skip-manual-testing PRs that do not need to be tested manually label Jan 16, 2025
@mgunnerud mgunnerud merged commit cf7174b into main Jan 17, 2025
12 checks passed
@mgunnerud mgunnerud deleted the chore/access-packages-release branch January 17, 2025 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/authorization Area: Issues related to roles and rights on apps, such as who can instantiate, sign etc. frontend skip-manual-testing PRs that do not need to be tested manually solution/studio/designer Issues related to the Altinn Studio Designer solution. team/studio-core team/studio-domain2
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants