Skip to content

Commit

Permalink
childs to children
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Gaudreault <alexandre_gaudreault@intuit.com>
  • Loading branch information
agaudreault committed May 13, 2024
1 parent 5b6c110 commit b2e17a8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
37 changes: 18 additions & 19 deletions docs/developer-guide/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,32 @@

https://github.com/argoproj/gitops-engine

### Pulling changes from `gitops-engine`
### Pulling changes from `gitops-engine`

After your GitOps Engine PR has been merged, ArgoCD needs to be updated to pull in the version of the GitOps engine that contains your change. Here are the steps:
After your GitOps Engine PR has been merged, ArgoCD needs to be updated to pull in the version of the GitOps engine that contains your change. Here are the steps:

* Retrieve the SHA hash for your commit. You will use this in the next step.
* From the `argo-cd` folder, run the following command
- Retrieve the SHA hash for your commit. You will use this in the next step.
- From the `argo-cd` folder, run the following command

`go get github.com/argoproj/gitops-engine@<git-commit-sha>`
`go get github.com/argoproj/gitops-engine@<git-commit-sha>`

If you get an error message `invalid version: unknown revision` then you got the wrong SHA hash
If you get an error message `invalid version: unknown revision` then you got the wrong SHA hash

* Run:
- Run:

`go mod tidy`
`go mod tidy`

* The following files are changed:
- The following files are changed:

- `go.mod`
- `go.sum`
- `go.mod`
- `go.sum`

* Create an ArgoCD PR with a `refactor:` type in its title for the two file changes.
- Create an ArgoCD PR with a `refactor:` type in its title for the two file changes.

### Tips:
* See https://github.com/argoproj/argo-cd/pull/4434 as an example
* The PR might require additional, dependent changes in ArgoCD that are directly impacted by the changes made in the engine.

- See https://github.com/argoproj/argo-cd/pull/4434 as an example
- The PR might require additional, dependent changes in ArgoCD that are directly impacted by the changes made in the engine.

## Argo UI Components

Expand All @@ -45,10 +46,8 @@ If you make changes to the Argo UI component, and your Argo CD changes depend on
1. Make changes to Argo UI and submit the PR request.
2. Also, prepare your Argo CD changes, but don't create the PR just yet.
3. **After** the Argo UI PR has been merged to master, then as part of your Argo CD changes:
- Run `yarn add git+https://github.com/argoproj/argo-ui.git` in the `ui/` directory, and then,
- Check in the regenerated yarn.lock file as part of your Argo CD commit
4. Create the Argo CD PR when you are ready. The PR build and test checks should pass.
- Run `yarn add git+https://github.com/argoproj/argo-ui.git` in the `ui/` directory, and then,
- Check in the regenerated yarn.lock file as part of your Argo CD commit
4. Create the Argo CD PR when you are ready. The PR build and test checks should pass.

If your Argo UI change is a 'stand-alone' fix, and you simply want Argo CD to pull in your change, then simply create an Argo CD PR with the yarn.lock file change.


15 changes: 8 additions & 7 deletions ui/src/app/applications/components/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,16 @@ export function findChildPod(node: appModels.ResourceNode, tree: appModels.Appli
export function findChildResources(node: appModels.ResourceNode, tree: appModels.ApplicationTree): appModels.ResourceNode[] {
const key = nodeKey(node);

const childs: appModels.ResourceNode[] = [];
const children: appModels.ResourceNode[] = [];
tree.nodes.forEach(item => {
(item.parentRefs || []).forEach(parent => {
if (key === nodeKey(parent)) {
childs.push(item);
children.push(item);
}
});
});

return childs;
return children;
}

const deletePodAction = async (ctx: ContextApis, pod: appModels.ResourceNode, app: appModels.Application) => {
Expand Down Expand Up @@ -371,14 +371,15 @@ export const deletePopup = async (
<div>
<p>
Are you sure you want to delete <strong>{resource.kind}</strong> <kbd>{resource.name}</kbd>?
<span style={{display: 'block', marginBottom: '10px'}} />
</p>
<p>
Deleting resources can be <strong>dangerous</strong>. Be sure you understand the effects of deleting this resource before continuing. Consider asking someone to
review the change first.
</p>

{(childResources || []).length > 0 ? (
<p>
Dependent resources:
<React.Fragment>
<p>Dependent resources:</p>
<ul>
{childResources.slice(0, 4).map((child, i) => (
<li key={i}>
Expand All @@ -394,7 +395,7 @@ export const deletePopup = async (
)}
{childResources.length > 5 ? <li key='N'>and {childResources.slice(4).length} more.</li> : ''}
</ul>
</p>
</React.Fragment>
) : (
''
)}
Expand Down

0 comments on commit b2e17a8

Please sign in to comment.