Skip to content

Conversation

@tanushree-akamai
Copy link
Contributor

Description 📝

This PR implements the display of Lock/Unlock action in action menu for Linodes. The feature is gated behind a feature flag (resourceLock.linodes)

Changes 🔄

  • Added ResourceLockFlag to featureFlags
  • Added lock permissions to IAM types:
    • AccountAdmin: create_lock, list_locks, view_lock, delete_lock
    • AccountViewer: list_locks, view_lock
  • Updated LinodeActionMenu to show Lock/Unlock actions
    • Only visible when resourceLock feature flag is enabled
    • Disabled with tooltips when user lacks permissions

Scope 🚢

Upon production release, changes in this PR will be visible to:

  • All customers
  • Some customers (e.g. in Beta or Limited Availability)
  • No customers / Not applicable

Preview 📷

  1. Added ResourceLockFlag to featureFlags
    Before
    Screenshot 2026-01-22 at 1 45 56 PM
    After
    Screenshot 2026-01-22 at 1 46 10 PM

  2. Updated LinodeActionMenu to show Lock/Unlock actions

Screenshot 2026-01-22 at 2 01 07 PM

Screenshot 2026-01-22 at 2 00 59 PM

  1. Added lock permissions to IAM:

Screenshot 2026-01-22 at 1 54 38 PM

Screenshot 2026-01-22 at 1 54 20 PM |

How to test 🧪

Reproduction steps

  • Open DevTools Panel
  • Enable the Resource Lock feature: Find resourceLock -> linodes ->Toggle to true
  • In DevTools Panel, navigate to "MSW" section
  • Enable CRUD mocks: Toggle "Enable MSW" to ON -> Select "CRUD" preset
  • In DevTools Panel, navigate to "Seeds" section -> Set seed counts: Linodes: 10, Resource Locks: 5
  • Navigate to "User Permissions" section
  • Select "Custom User Account Permissions"
  • Click "Edit" to modify permissions
  • Update the permissions array to include lock permissions:
    [ "create_lock", "delete_lock" ]
  • Click on Apply

Verification steps

  • Navigate to /linodes
  • Confirm Lock/Unlock action appears in Linode list and detail action menu
  • Verify Permission-Based Behavior:
  • With full permissions: Action is enabled (clickable)
  • Without permissions: Action is disabled with a tooltip showing "You don't have permission to edit this Linode"
  • Lock Status Display:
  • Linodes with locks show "Unlock" action
  • Linodes without locks show "Lock" action
Author Checklists

As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support


  • I have read and considered all applicable items listed above.

As an Author, before moving this PR from Draft to Open, I confirmed ✅

  • All tests and CI checks are passing
  • TypeScript compilation succeeded without errors
  • Code passes all linting rules

@linode-gh-bot
Copy link
Collaborator

Cloud Manager UI test results

🔺 1 failing test on test run #2 ↗︎

❌ Failing✅ Passing↪️ Skipped🕐 Duration
1 Failing864 Passing11 Skipped35m 13s

Details

Failing Tests
SpecTest
clone-linode.spec.tsCloud Manager Cypress Tests→clone linode » can clone a Linode from Linode details page

Troubleshooting

Use this command to re-run the failing tests:

pnpm cy:run -s "cypress/e2e/core/linodes/clone-linode.spec.ts"

const [isOpen, setIsOpen] = React.useState<boolean>(false);

const isResourceLockEnabled = flags.resourceLock?.linodes;
const { data: locksData } = useLocksQuery({}, {}, isResourceLockEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we look for lockData using useLockQuery as this GET call should be for individual linode item?

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

Labels

Projects

Status: Review

Development

Successfully merging this pull request may close these issues.

3 participants