Skip to content

SRVOCF-1039: add file and folder deletion to the edit page - #148

Open
pmeida wants to merge 1 commit into
openshift:masterfrom
pmeida:SRVOCF-953-delete-files
Open

SRVOCF-1039: add file and folder deletion to the edit page#148
pmeida wants to merge 1 commit into
openshift:masterfrom
pmeida:SRVOCF-953-delete-files

Conversation

@pmeida

@pmeida pmeida commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • Add "Delete File" / "Delete Folder" kebab menu to each file tree entry
  • Support deletion via PUT /api/v1/func/{owner}/{name}/file - entries with deleted=trueare pushed to GitHub with sha=null
  • Action button visibility: hover/active-item show via CSS, inline style only forces visible when menu is open
  • Memoize dirtyFiles, originalByPath, and stabilize onFileDelete with useCallback to avoid unnecessary tree rebuilds
  • Backend, unit, and e2e tests for the full deletion flow
Aug-21-2026 11-09-32

Fixes SRVOCF-1039

Checklist

  • Updated docs/ARCHITECTURE.md (if there are relevant changes to our layered architecture)

@openshift-ci-robot

openshift-ci-robot commented Aug 20, 2026

Copy link
Copy Markdown

@pmeida: This pull request references SRVOCF-953 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the epic to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

Fixes SRVOCF-XXX

Checklist

  • Updated docs/ARCHITECTURE.md (if there are relevant changes to our layered architecture)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Aug 20, 2026
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 20, 2026
@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Aug 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pmeida

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 20, 2026
@pmeida
pmeida force-pushed the SRVOCF-953-delete-files branch from 40bf02a to 135f86c Compare August 21, 2026 09:28
@pmeida pmeida changed the title SRVOCF-953: add file and folder deletion to the edit page SRVOCF-1039: add file and folder deletion to the edit page Aug 21, 2026
@openshift-ci-robot

openshift-ci-robot commented Aug 21, 2026

Copy link
Copy Markdown

@pmeida: This pull request references SRVOCF-1039 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.1.0" version, but no target version was set.

Details

In response to this:

Summary

Fixes SRVOCF-953

Checklist

  • Updated docs/ARCHITECTURE.md (if there are relevant changes to our layered architecture)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@pmeida
pmeida force-pushed the SRVOCF-953-delete-files branch 3 times, most recently from b62c354 to c93cf06 Compare August 21, 2026 10:03
@pmeida

pmeida commented Aug 21, 2026

Copy link
Copy Markdown
Author

Topic for discussion:

I am retrospecting around letting users delete critical files like func.yaml and workflow/func-deploy.yaml  as this would cause a failure. Or even, why show them at all? Yes I know they could do both eitherway through the repo.

@pmeida
pmeida marked this pull request as ready for review August 21, 2026 10:21
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 21, 2026
@openshift-ci
openshift-ci Bot requested review from Cragsmann and twoGiants August 21, 2026 10:22
Comment on lines +61 to +67
<style>{`
.file-actions-btn { visibility: hidden; }
.pf-v6-c-tree-view__list-item:hover > .pf-v6-c-tree-view__content .file-actions-btn { visibility: visible; }
.pf-v6-c-tree-view__list-item:hover:has(.pf-v6-c-tree-view__list-item:hover) > .pf-v6-c-tree-view__content .file-actions-btn { visibility: hidden; }
.pf-v6-c-tree-view__list-item:has(> .pf-v6-c-tree-view__content > .pf-v6-c-tree-view__node.pf-m-current) > .pf-v6-c-tree-view__content .file-actions-btn { visibility: visible; }
.pf-v6-c-tree-view__action { margin-inline-end: 0; }
`}</style>

@pmeida pmeida Aug 21, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The action button visibility is controlled by CSS rather than React state because the hover trigger lives on PatternFly's internal <li> element (.pf-v6-c-tree-view__list-item), which we don't render or control. There's no way to attach onMouseEnter/onMouseLeave to it without hacking the DOM.

I understand this is ugly and an outlier in our repo.
Moving to a separate CSS file could be cleaner.

Please let me know if you have a better way to achieve the same behaviour or if you are fine with having this block.

Adds a kebab menu action on each file tree entry that sends deleted
entries to the GitHub Git Trees API with SHA=null, removing them from
the repository on save.

Adds backend, unit, and e2e tests for the deletion flow.
@pmeida
pmeida force-pushed the SRVOCF-953-delete-files branch from c93cf06 to 7fdf5e0 Compare August 21, 2026 10:31
@openshift-ci

openshift-ci Bot commented Aug 21, 2026

Copy link
Copy Markdown

@pmeida: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants