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

fix: refresh freightline after warehouse completes refresh #1276

Merged
merged 4 commits into from
Dec 15, 2023

Conversation

rbreeze
Copy link
Contributor

@rbreeze rbreeze commented Dec 14, 2023

Fixes #1202 (for real this time 🙂)

Signed-off-by: Remington Breeze <remington@breeze.software>
@rbreeze rbreeze requested a review from a team as a code owner December 14, 2023 16:48
Copy link

netlify bot commented Dec 14, 2023

Deploy Preview for docs-kargo-akuity-io failed.

Name Link
🔨 Latest commit 9e866f2
🔍 Latest deploy log https://app.netlify.com/sites/docs-kargo-akuity-io/deploys/657b33eb12842b0008a38095

@@ -37,7 +37,10 @@ export const RepoNode = ({ nodeData, children }: Props) => {
<div className='text-ellipsis whitespace-nowrap overflow-hidden'>
{nodeData.warehouseName}
</div>
{nodeData.type !== NodeType.REPO_CHART && <FontAwesomeIcon icon={faBuilding} />}
<div className='flex items-center'>
{nodeData.refreshing && <FontAwesomeIcon icon={faCircleNotch} spin className='mr-2' />}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adds refresh indicator for Warehouse nodes

Signed-off-by: Remington Breeze <remington@breeze.software>
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e8a43bb) 48.50% compared to head (9e866f2) 48.79%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1276      +/-   ##
==========================================
+ Coverage   48.50%   48.79%   +0.29%     
==========================================
  Files         127      127              
  Lines        9675     9746      +71     
==========================================
+ Hits         4693     4756      +63     
- Misses       4823     4830       +7     
- Partials      159      160       +1     

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

Signed-off-by: Remington Breeze <remington@breeze.software>
Signed-off-by: Remington Breeze <remington@breeze.software>
refetchAvailableFreight();
}

const refreshing = e.warehouse?.metadata?.annotations['kargo.akuity.io/refresh'];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If refresh annotation is found on a warehouse, we don't refetch freight yet. Instead, save it to a map which indicates it started refreshing

refresh[e.warehouse?.metadata?.name || ''] = true;
alert('detected refresh for warehouse');
} else if (refresh[e.warehouse?.metadata?.name || '']) {
delete refresh[e.warehouse?.metadata?.name || ''];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If refresh annotation is not present, and this warehouse was refreshing previously, remove it from the map and refresh the freight line

Copy link
Member

@jessesuen jessesuen left a comment

Choose a reason for hiding this comment

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

rubber stamp approval

@rbreeze rbreeze added this pull request to the merge queue Dec 15, 2023
Merged via the queue into main with commit a81e30b Dec 15, 2023
12 of 15 checks passed
@rbreeze rbreeze deleted the freightline-refresh branch December 15, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warehouse refresh from UI should update freightline
2 participants