Skip to content

Commit

Permalink
Fixing broken manifest links (#881)
Browse files Browse the repository at this point in the history
* Fixing broken manifest links

* More robust dependency handling
  • Loading branch information
laszlocph authored Nov 16, 2024
1 parent fab1eb4 commit e136dc8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions pkg/dashboard/server/gitContents.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,7 @@ func saveEnvConfig(w http.ResponseWriter, r *http.Request) {
return
}

gitRepoCache.Invalidate(repoPath)
w.WriteHeader(http.StatusOK)
w.Write(responseJson)
return
Expand Down
3 changes: 3 additions & 0 deletions pkg/dx/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ func (d *Dependency) UnmarshalJSON(data []byte) error {
}

d.Name = dat["name"].(string)
if _, ok := dat["kind"]; !ok {
return fmt.Errorf("kind is mandatory for dependency")
}
d.Kind = dat["kind"].(string)

switch d.Kind {
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/env/env.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function Env(props) {
const { env, repoRolloutHistory, envConfigs, navigateToConfigEdit, linkToDeployment, rollback, owner, repoName, fileInfos } = props;
const { releaseHistorySinceDays, deploymentFromParams, settings, alerts, appFilter } = props;

const renderedServices = renderServices(env.stacks, envConfigs, env, repoRolloutHistory, navigateToConfigEdit, linkToDeployment, rollback, owner, repoName, fileInfos, releaseHistorySinceDays, gimletClient, store, deploymentFromParams, settings.scmUrl, alerts, appFilter);
const renderedServices = renderServices(env.stacks, envConfigs, env, repoRolloutHistory, navigateToConfigEdit, linkToDeployment, rollback, owner, repoName, fileInfos, releaseHistorySinceDays, gimletClient, store, deploymentFromParams, settings, alerts, appFilter);
const navigate = useNavigate()

return (
Expand Down
15 changes: 13 additions & 2 deletions web/src/views/deployWizzard/deployWizzard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import SimpleServiceDetail from '../../components/serviceDetail/simpleServiceDet
import DeployHandler from '../../deployHandler';
import Confetti from 'react-confetti'
import { Loading } from '../repo/deployStatus';
import { ACTION_TYPE_CLEAR_DEPLOY } from "../../redux/redux";
import {
ACTION_TYPE_CLEAR_DEPLOY,
ACTION_TYPE_REPO_METAS,
} from "../../redux/redux";
import { v4 as uuidv4 } from 'uuid';
import SealedSecretWidget from "../envConfig/sealedSecretWidget";
import { useParams, useNavigate } from 'react-router-dom'
Expand Down Expand Up @@ -253,7 +256,15 @@ export function DeployWizzard(props) {
bodyClassName: "p-2",
autoClose: false
});

gimletClient.getRepoMetas(owner, repo)
.then(data => {
store.dispatch({
type: ACTION_TYPE_REPO_METAS, payload: {
repoMetas: data,
}
});
}, () => {/* Generic error handler deals with it */
});
setSavingConfigInProgress(false)
navigate(`/repo/${repoName}`);
window.scrollTo({ top: 0, left: 0 });
Expand Down
6 changes: 1 addition & 5 deletions web/src/views/repo/repo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,6 @@ export default function Repo(props) {
navigate(`/repo/${owner}/${repo}/${env}/${deployment}?${location.search}`)
}

const fileMetasByEnv = (envName) => {
return fileInfos.filter(fileInfo => fileInfo.envName === envName)
}

const stacksForRepo = envsForRepo(envs, connectedAgents, repoName);

let repoRolloutHistory = undefined;
Expand Down Expand Up @@ -177,7 +173,7 @@ export default function Repo(props) {
}}
owner={owner}
repoName={repo}
fileInfos={fileMetasByEnv(envName)}
fileInfos={fileInfos.filter(fileInfo => fileInfo.envName === envName)}
releaseHistorySinceDays={settings.releaseHistorySinceDays}
gimletClient={gimletClient}
store={store}
Expand Down

0 comments on commit e136dc8

Please sign in to comment.