Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-code-coverage-folder-percentage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage-community/plugin-code-coverage': patch
---

Fix folder coverage calculation to use aggregated tracked and missing lines instead of averaging child coverage percentages.
5 changes: 5 additions & 0 deletions .changeset/pretty-items-try.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage-community/plugins': patch
---

docs(feedback): add new frontend / hybrid migration notice
Copy link
Member

Choose a reason for hiding this comment

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

run yarn changeset from the code-coverage workspace instead of the root

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I regenerated the changeset from the plugin-code-coverage workspace (not root) and pushed the update. Please let me know if anything else is needed.

Original file line number Diff line number Diff line change
Expand Up @@ -93,27 +93,30 @@ const removeVisitedPathGroup = (

export const buildFileStructure = (row: CoverageTableRow) => {
const dataGroupedByPath: FileStructureObject = groupByPath(row.files);

row.files = Object.keys(dataGroupedByPath).map(pathGroup => {
const aggregatedTracked = dataGroupedByPath[pathGroup].reduce(
(acc: number, cur: CoverageTableRow) => acc + cur.tracked,
0,
);

const aggregatedMissing = dataGroupedByPath[pathGroup].reduce(
(acc: number, cur: CoverageTableRow) => acc + cur.missing,
0,
);

return buildFileStructure({
path: pathGroup,
files: dataGroupedByPath.hasOwnProperty('files')
? removeVisitedPathGroup(dataGroupedByPath.files, pathGroup)
: removeVisitedPathGroup(dataGroupedByPath[pathGroup], pathGroup),
files: removeVisitedPathGroup(dataGroupedByPath[pathGroup], pathGroup),
coverage:
dataGroupedByPath[pathGroup].reduce(
(acc: number, cur: CoverageTableRow) => acc + cur.coverage,
0,
) / dataGroupedByPath[pathGroup].length,
missing: dataGroupedByPath[pathGroup].reduce(
(acc: number, cur: CoverageTableRow) => acc + cur.missing,
0,
),
tracked: dataGroupedByPath[pathGroup].reduce(
(acc: number, cur: CoverageTableRow) => acc + cur.tracked,
0,
),
aggregatedTracked > 0
? ((aggregatedTracked - aggregatedMissing) / aggregatedTracked) * 100
: 0,
missing: aggregatedMissing,
tracked: aggregatedTracked,
});
});

return row;
};

Expand Down
12 changes: 12 additions & 0 deletions workspaces/feedback/plugins/feedback/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ It is dedicated to simplifying the process of gathering and managing user feedba

### Plugin Setup

## New Frontend / Hybrid Migration Notice
Copy link
Member

Choose a reason for hiding this comment

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

these changes aren't expected right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these changes aren't expected right?

You are right that README change was not intended for this PR. I have reverted it and pushed the update. Thanks for pointing it out.


The Feedback plugin currently has limited support for the new
Backstage frontend and hybrid migration setups.

The following steps are **legacy frontend only**:

- Adding routes in `App.tsx` using `FlatRoutes`
- Registering components directly in `AppRouter`

## The backend configuration and catalog annotations remain the same for both legacy and new frontend setups.

1. Install the plugin in your environment

```bash
Expand Down
Loading