Skip to content

Commit

Permalink
fix: Add missing 'archived' prop for ArtifactPanel component. Fixes #…
Browse files Browse the repository at this point in the history
…12331 (#12397)

Signed-off-by: Garett MacGowan <garettsoftware@gmail.com>
  • Loading branch information
Garett-MacGowan committed Jan 12, 2024
1 parent 44b33fa commit b447951
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 3 deletions.
24 changes: 24 additions & 0 deletions test/e2e/argo_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,30 @@ spec:
})
}

func (s *ArgoServerSuite) TestArtifactServerArchivedWorkflow() {
var uid types.UID
var nodeID string
s.Given().
Workflow(`@testdata/artifact-passing-workflow.yaml`).
When().
SubmitWorkflow().
WaitForWorkflow(fixtures.ToBeArchived).
Then().
ExpectWorkflow(func(t *testing.T, metadata *metav1.ObjectMeta, status *wfv1.WorkflowStatus) {
uid = metadata.UID
nodeID = status.Nodes.FindByDisplayName("generate-artifact").ID
})

// In this case, the artifact name is a file
s.Run("GetArtifactByNodeID", func() {
s.e().GET("/artifact-files/argo/archived-workflows/{uid}/{nodeID}/outputs/hello", uid, nodeID).
Expect().
Status(200).
Body().
Contains(":) Hello Argo!")
})
}

func (s *ArgoServerSuite) TestArtifactServerArchivedStoppedWorkflow() {
var uid types.UID
var nodeID string
Expand Down
45 changes: 45 additions & 0 deletions test/e2e/testdata/artifact-passing-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: artifact-passing-
spec:
entrypoint: artifact-example
templates:
- name: artifact-example
steps:
- - name: generate-artifact
template: create-message
- - name: consume-artifact
template: print-message
arguments:
artifacts:
# bind message to the hello artifact
# generated by the generate-artifact step
- name: message
from: "{{steps.generate-artifact.outputs.artifacts.hello}}"

- name: create-message
container:
image: alpine:latest
command: [sh, -c]
args: ["echo ':) Hello Argo!' | tee /tmp/hello_world.txt"]
outputs:
artifacts:
# generate hello artifact from /tmp/hello_world.txt
# artifacts can be directories as well as files
- name: hello
path: /tmp/hello_world.txt
archive:
none: {}

- name: print-message
inputs:
artifacts:
# unpack the message input artifact
# and put it at /tmp/message
- name: message
path: /tmp/message
container:
image: alpine:latest
command: [sh, -c]
args: ["cat /tmp/message"]
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ArtifactPanel({
}: {
workflow: Workflow;
artifact: Artifact & {nodeId: string; artifactNameDiscriminator: string};
archived?: boolean;
archived: boolean;
artifactRepository: ArtifactRepository;
}) {
const input = artifact.artifactNameDiscriminator === 'input';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps<

const podName = ensurePodName(workflow, selectedNode, nodeId);

const archived = isArchivedWorkflow(workflow);

return (
<Page
title={'Workflow Details'}
Expand Down Expand Up @@ -567,11 +569,13 @@ export function WorkflowDetails({history, location, match}: RouteComponentProps<
onShowContainerLogs={(x, container) => setSidePanel(`logs:${x}:${container}`)}
onShowEvents={() => setSidePanel(`events:${nodeId}`)}
onShowYaml={() => setSidePanel(`yaml:${nodeId}`)}
archived={isArchivedWorkflow(workflow)}
archived={archived}
onResume={() => renderResumePopup()}
/>
)}
{selectedArtifact && <ArtifactPanel workflow={workflow} artifact={selectedArtifact} artifactRepository={selectedTemplateArtifactRepo} />}
{selectedArtifact && (
<ArtifactPanel workflow={workflow} artifact={selectedArtifact} archived={archived} artifactRepository={selectedTemplateArtifactRepo} />
)}
</div>
</div>
))}
Expand Down

0 comments on commit b447951

Please sign in to comment.