This repository was archived by the owner on Jun 26, 2026. It is now read-only.
Repository navigation
fix: List page crashes and missing rows #40
Closed
Cragsmann
wants to merge
7
commits into
functions-dev:master
from
Cragsmann:SRVOCF-840--fix-list-page-crashes
Closed
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
845ef68
SRVOCF-840: Fix list page crashes and missing rows
Cragsmann 337bb6b
SRVOCF-840: fix lint import
Cragsmann 4cde369
SRVOCF-840: fix review comments
Cragsmann eb2573b
fix: show error items instead of dropping repos
Cragsmann 62e24bd
Merge branch 'master' into SRVOCF-840--fix-list-page-crashes
Cragsmann 9c0ff8e
test: update test for error item behavior
Cragsmann ce1db3b
fix: address PR review on error handling
Cragsmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ import { | |
| import { useClusterService } from '../../common/services/cluster/useClusterService'; | ||
| import { SourceControlService } from '../../common/services/source-control/SourceControlService'; | ||
| import { useSourceControlService } from '../../common/services/source-control/useSourceControlService'; | ||
| import { errorMessage, parseNamespaceAndRuntime } from '../../common/utils/utils'; | ||
| import { errorMessage, parseFuncYaml } from '../../common/utils/utils'; | ||
|
|
||
| export default function FunctionsListPage() { | ||
| return ( | ||
|
|
@@ -219,19 +219,30 @@ function useFunctionListPage(): { | |
|
|
||
| async function loadFunctionTableItems(svc: SourceControlService): Promise<FunctionTableItem[]> { | ||
| const repos = await svc.listFunctionRepos(); | ||
| const items = await Promise.all( | ||
| const results = await Promise.all( | ||
| repos.map(async (repo) => { | ||
| const funcYaml = await svc.fetchFileContent(repo, 'func.yaml'); | ||
| const { namespace, runtime } = parseNamespaceAndRuntime(funcYaml); | ||
| return newItem(repo.name, namespace, runtime); | ||
| try { | ||
| const funcYaml = await svc.fetchFileContent(repo, 'func.yaml'); | ||
| const { name, namespace, runtime } = parseFuncYaml(funcYaml); | ||
| return newItem(name || repo.name, repo.name, namespace, runtime); | ||
| } catch (err: unknown) { | ||
| console.warn(`Skipping repo ${repo.name}: ${err instanceof Error ? err.message : err}`); | ||
| return null; | ||
|
matejvasek marked this conversation as resolved.
Outdated
|
||
| } | ||
| }), | ||
| ); | ||
| return items; | ||
| return results.filter((item): item is FunctionTableItem => item !== null); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we are returning
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Issue addresed in Openshift repo's PR openshift#4 |
||
| } | ||
|
|
||
| function newItem(repoName: string, namespace: string, runtime: string): FunctionTableItem { | ||
| function newItem( | ||
| name: string, | ||
| repoName: string, | ||
| namespace: string, | ||
| runtime: string, | ||
| ): FunctionTableItem { | ||
| return { | ||
| name: repoName, | ||
| name, | ||
| repoName, | ||
| namespace, | ||
| runtime, | ||
| status: 'NotDeployed' as const, | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may also throw if there is syntax error in
func.yaml, which results in infinite "Loading sources…".Screencast.From.2026-06-19.13-44-41.mp4
However feel free to create separate bugreport/pr for this if you want.