Skip to content

Commit

Permalink
chore: Update headlamp image tag (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
callmevladik committed Apr 26, 2024
1 parent 2c7210a commit 469e1ea
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM epamedp/headlamp:0.22.10
FROM epamedp/headlamp:0.22.11

COPY --chown=100:101 assets/ /headlamp/frontend
COPY --chown=100:101 dist/main.js /headlamp/plugins/edp/main.js
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"plugins"
],
"scripts": {
"build": "headlamp-plugin build",
"build:prod": "headlamp-plugin build",
"format": "headlamp-plugin format",
"lint": "headlamp-plugin lint & headlamp-plugin tsc",
"tsc": "headlamp-plugin tsc",
Expand Down
52 changes: 33 additions & 19 deletions src/pages/edp-stage-details/providers/DynamicData/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const filterByLabels = (items: KubeObjectInterface[], labels: Record<string, str
};

const sortFn = (data: PipelineRunKubeObjectInterface[]) =>
data.sort(sortKubeObjectByCreationTimestamp).slice(0, 10);
data.sort(sortKubeObjectByCreationTimestamp);

export const DynamicDataContextProvider: React.FC = ({ children }) => {
const { CDPipelineName, stageName, namespace } = useParams<EDPStageDetailsRouteParams>();
Expand All @@ -44,15 +44,12 @@ export const DynamicDataContextProvider: React.FC = ({ children }) => {
const [pipelineRuns, pipelineRunsError] = PipelineRunKubeObject.useList();
const [gitServers, gitServersError] = EDPGitServerKubeObject.useList();

const sortedPipelineRuns = React.useMemo(() => {
if (pipelineRuns === null) {
return null; //loading
}

return sortFn(pipelineRuns);
}, [pipelineRuns]);
const sortedPipelineRuns = React.useMemo(
() => (pipelineRuns === null ? null : sortFn(pipelineRuns)),
[pipelineRuns]
);

const latestTenDeployPipelineRuns = React.useMemo(() => {
const deployPipelineRuns = React.useMemo(() => {
if (!stageMetadataName || !CDPipelineName || sortedPipelineRuns === null) {
return null; // loading
}
Expand All @@ -63,9 +60,13 @@ export const DynamicDataContextProvider: React.FC = ({ children }) => {
[PIPELINE_RUN_LABEL_SELECTOR_PIPELINE_TYPE]: PIPELINE_TYPES.DEPLOY,
});
}, [CDPipelineName, sortedPipelineRuns, stageMetadataName]);
const latestTenDeployPipelineRuns = React.useMemo(
() => (deployPipelineRuns === null ? null : deployPipelineRuns?.slice(0, 10)),
[deployPipelineRuns]
);

const latestTenAutotestRunnerPipelineRuns = React.useMemo(() => {
if (!stageSpecName || !CDPipelineName || sortedPipelineRuns === null) {
const autotestRunnerPipelineRuns = React.useMemo(() => {
if (!stageMetadataName || !CDPipelineName || sortedPipelineRuns === null) {
return null; // loading
}

Expand All @@ -74,24 +75,35 @@ export const DynamicDataContextProvider: React.FC = ({ children }) => {
[PIPELINE_RUN_LABEL_SELECTOR_STAGE]: stageSpecName,
[PIPELINE_RUN_LABEL_SELECTOR_PIPELINE_TYPE]: PIPELINE_TYPES.AUTOTEST_RUNNER,
});
}, [CDPipelineName, sortedPipelineRuns, stageSpecName]);

const latestAutotestRunnerPipelineRunName = React.useMemo(
() => latestTenAutotestRunnerPipelineRuns?.[0]?.metadata.name,
[latestTenAutotestRunnerPipelineRuns]
}, [CDPipelineName, sortedPipelineRuns, stageMetadataName, stageSpecName]);
const latestTenAutotestRunnerPipelineRuns = React.useMemo(
() => (autotestRunnerPipelineRuns === null ? null : autotestRunnerPipelineRuns?.slice(0, 10)),
[autotestRunnerPipelineRuns]
);

const latestTenAutotestPipelineRuns = React.useMemo(() => {
if (!stageSpecName || !CDPipelineName || sortedPipelineRuns === null) {
const autotestPipelineRuns = React.useMemo(() => {
if (!stageMetadataName || !CDPipelineName || sortedPipelineRuns === null) {
return null; // loading
}

const latestAutotestRunnerPipelineRunName = autotestRunnerPipelineRuns?.[0]?.metadata.name;

return filterByLabels(sortedPipelineRuns, {
[PIPELINE_RUN_LABEL_SELECTOR_PIPELINE]: CDPipelineName,
[PIPELINE_RUN_LABEL_SELECTOR_STAGE]: stageSpecName,
[PIPELINE_RUN_LABEL_SELECTOR_PARENT_PIPELINE_RUN]: latestAutotestRunnerPipelineRunName,
});
}, [CDPipelineName, latestAutotestRunnerPipelineRunName, sortedPipelineRuns, stageSpecName]);
}, [
CDPipelineName,
autotestRunnerPipelineRuns,
sortedPipelineRuns,
stageMetadataName,
stageSpecName,
]);
const latestTenAutotestPipelineRuns = React.useMemo(
() => (autotestPipelineRuns === null ? null : autotestPipelineRuns?.slice(0, 10)),
[autotestPipelineRuns]
);

const argoApplications = useStreamApplicationListByPipelineStageLabel({
namespace,
Expand Down Expand Up @@ -163,6 +175,8 @@ export const DynamicDataContextProvider: React.FC = ({ children }) => {
]
);

console.log(DataContextValue);

return (
<DynamicDataContext.Provider value={DataContextValue}>{children}</DynamicDataContext.Provider>
);
Expand Down

0 comments on commit 469e1ea

Please sign in to comment.