From 7bdd33224ff149b31caf0a20cde2d1392bf1d3de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Oct 2022 15:26:14 +0000 Subject: [PATCH 01/13] docs: updated CHANGELOG.md (#9892) --- CHANGELOG.md | 163 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 121 insertions(+), 42 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2256f85f73c2..937b937401bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,49 +1,128 @@ # Changelog +## v3.4.2 (2022-10-22) + + * [b00550f7b](https://github.com/argoproj/argo-workflows/commit/b00550f7bae3938d324ce2857019529d61382d84) chore(deps): bump github.com/prometheus/client_model from 0.2.0 to 0.3.0 (#9885) + * [a6e5b6ce7](https://github.com/argoproj/argo-workflows/commit/a6e5b6ce78acd210f6d8f42439948ac771084db8) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.41 to 7.0.42 (#9886) + * [c81b07145](https://github.com/argoproj/argo-workflows/commit/c81b071455c7850ae33ff842bf35275ef44a4065) chore(deps): bump github.com/valyala/fasttemplate from 1.2.1 to 1.2.2 (#9887) + * [ec5162983](https://github.com/argoproj/argo-workflows/commit/ec5162983fd5e3032e5d3162245eab28e41b694b) fix: P/R/C reporting in argo list -o wide. Fixes #9281 (#9874) + * [6c432d2c9](https://github.com/argoproj/argo-workflows/commit/6c432d2c980bd37be28ebb22d1e83b176993ce38) fix: upgrade python openapiclient version, fixes #9770 (#9840) + * [36646ef81](https://github.com/argoproj/argo-workflows/commit/36646ef81cb4775c1ef31861f01331bc75166e7b) fix: Support Kubernetes v1.24. Fixes #8320 (#9620) + * [05e1425f8](https://github.com/argoproj/argo-workflows/commit/05e1425f857264076e0de29124d4fbf74b4107b4) fix(server&ui): can't fetch inline artifact. Fixes #9817 (#9853) + * [ce3172804](https://github.com/argoproj/argo-workflows/commit/ce31728046cbfe0a58bfd31e20e63c7edec25437) feat(ui): Display detailed Start/End times in workflow-node-info. Fixes #7920 (#9834) + * [b323bb1e5](https://github.com/argoproj/argo-workflows/commit/b323bb1e570a6cbd347942bbce82e25a05c4ca92) fix(ui): view manifest error on inline node. Fixes #9841 (#9842) + * [9237a72f7](https://github.com/argoproj/argo-workflows/commit/9237a72f7999f375279d054232028e4931d737f3) fix(ui): containerset archive log query params. Fixes #9669 (#9833) + * [a752a583a](https://github.com/argoproj/argo-workflows/commit/a752a583a5b9295fddae5c2978ea5f4cee2687d2) fix: exit code always be '0' in windows container. Fixes #9797 (#9807) + * [af8347c36](https://github.com/argoproj/argo-workflows/commit/af8347c36d305a56c7c1355078b410f97e2ed3d5) chore(deps): Bump github.com/TwiN/go-color from v1.1.0 to v1.2.0 (#9794) + * [102c3ec22](https://github.com/argoproj/argo-workflows/commit/102c3ec22118a49ccfa75b9c3878d62057afb441) fix: migrated from distribution@v2.8.0 to distribution@v2.8.1. Fixes #9850 (#9851) + * [d4a907411](https://github.com/argoproj/argo-workflows/commit/d4a907411a7105ffda52a284e1059c6de9829bcf) fix: trigger startup.sh at devcontainer startup instead of create (#9831) + * [b7f9071d0](https://github.com/argoproj/argo-workflows/commit/b7f9071d0a5c57e8e6dfe2638dfc6dacca2af6cf) chore(deps-dev): bump @babel/preset-env from 7.19.3 to 7.19.4 in /ui (#9829) + * [9b9abf9ea](https://github.com/argoproj/argo-workflows/commit/9b9abf9eab7cc7ffdf27aabe4fb8d8d998bf42e7) chore(deps-dev): bump babel-jest from 29.1.2 to 29.2.0 in /ui (#9828) + * [ca750d056](https://github.com/argoproj/argo-workflows/commit/ca750d056db8d2d4005cf2f1dadb32e79be9b76a) chore(deps): bump github.com/TwiN/go-color from 1.1.0 to 1.2.0 (#9822) + * [593eab25c](https://github.com/argoproj/argo-workflows/commit/593eab25cade9f2a5b71fdef028d3886ff5e0e3c) chore(deps): bump google.golang.org/api from 0.98.0 to 0.99.0 (#9823) + * [1670dca60](https://github.com/argoproj/argo-workflows/commit/1670dca6092b51781ed5e1f2d2522b0c0bca0ced) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.40 to 7.0.41 (#9825) + * [e838214ed](https://github.com/argoproj/argo-workflows/commit/e838214ed452d4bff528da4a7a2f101ebf324277) chore(deps): bump cronstrue from 2.12.0 to 2.14.0 in /ui (#9826) + * [7d2081830](https://github.com/argoproj/argo-workflows/commit/7d2081830b8b77de37429958b7968d7073ef5f0c) chore(deps): bump nick-fields/retry from 2.8.1 to 2.8.2 (#9820) + * [f6a8b0130](https://github.com/argoproj/argo-workflows/commit/f6a8b0130dccb5a773fc52fd46354f8537d022cb) fix: SDK CI workflow (#9609) + * [faa0294f5](https://github.com/argoproj/argo-workflows/commit/faa0294f5c29fa10800f94677c21b7180d9b3da4) fix: fixed url encoded link template (#9792) + * [ebae212d7](https://github.com/argoproj/argo-workflows/commit/ebae212d709f039823737b495437c14898690376) fix(ui): missing url href formatting in template link. Fixes #9764 (#9790) + * [d4817efff](https://github.com/argoproj/argo-workflows/commit/d4817efffad2a1d96374f69f3b547bf3f9d758a9) fix: fix iam permissions to retrieve logs from aws s3 (#9798) + * [aa59b4374](https://github.com/argoproj/argo-workflows/commit/aa59b43748f78e599709add871af7ec14e1fd3c1) fix: enable when expressions to use expr; add new json variables to avoid expr conflicts (#9761) + * [0fc883a41](https://github.com/argoproj/argo-workflows/commit/0fc883a41c81c533c57ec64ca8c19279b38e60ec) fix: avoid nil pointer dereference. Fixes #9269 (#9787) + * [cd43bba6c](https://github.com/argoproj/argo-workflows/commit/cd43bba6c87d185bd1530c03c99b874eeceba966) fix: Send workflow UID to plugins. Fixes #8573 (#9784) + * [514aa050c](https://github.com/argoproj/argo-workflows/commit/514aa050cab63bba8e6af20700ad4aa7ed53bfd4) feat(server): server logs to be structured and add more log error #2308 (#9779) + * [f27fe08b1](https://github.com/argoproj/argo-workflows/commit/f27fe08b1b06ee86040371b5fa992b82b27d7980) fix: default not respected in setting global configmap params. Fixes #9745 (#9758) + * [dc48c8cf1](https://github.com/argoproj/argo-workflows/commit/dc48c8cf12eccb1cc447a4f9a32e1c7dfc4f93da) fix: Set scheduling constraints to the agent pod by the workflow. Fixes #9704 (#9771) + * [f767f39d8](https://github.com/argoproj/argo-workflows/commit/f767f39d86acb549ef29d8196f067280683afd4d) fix: artifactory not working. Fixes #9681 (#9782) + * [1fc6460fa](https://github.com/argoproj/argo-workflows/commit/1fc6460fa16b157b0d333b96d6d93b7d273ed91a) fix: Log early abort. Fixes #9573 (#9575) + * [f1bab8947](https://github.com/argoproj/argo-workflows/commit/f1bab8947c44f9fc0483dc6489b098e04e0510f7) fix: a WorkflowTemplate doesn't need to define workflow-level input p… (#9762) + * [b12b5f987](https://github.com/argoproj/argo-workflows/commit/b12b5f9875b2a070bbcb0a3a16154495c196e6b2) fix: SSO integration not considering HTTP_PROXY when making requests. Fixes #9259 (#9760) + * [529dc0fec](https://github.com/argoproj/argo-workflows/commit/529dc0fec443cd33171d32e7f798ceeaddef1587) feat(ui): add v3.4 feature info (#9777) + * [a8e37e9be](https://github.com/argoproj/argo-workflows/commit/a8e37e9bea5d586f8b1811fcbb8df668d00bdb31) fix: Concurrent map read and map write in agent. Fixes #9685 (#9689) + * [1bbdf0d2a](https://github.com/argoproj/argo-workflows/commit/1bbdf0d2ad5a74832ecff5a6e13a758bdf54e909) feat: Added workflow summary to workflow-list page. (#9693) + * [82201d521](https://github.com/argoproj/argo-workflows/commit/82201d521d91cfa2926584864edbdc8a15e9a5ad) chore(deps): bump cronstrue from 2.11.0 to 2.12.0 in /ui (#9774) + * [d7febc928](https://github.com/argoproj/argo-workflows/commit/d7febc92818fa2cbee5eb32cbf6169beb739673d) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.39 to 7.0.40 (#9773) + * [d64b8d397](https://github.com/argoproj/argo-workflows/commit/d64b8d3976c4cd7592b9433be20547a80f28e289) fix: quick-start-* manifests pointing to invalid httpbin image tag. Fixes #9659 (#9759) + * [de4ea2d51](https://github.com/argoproj/argo-workflows/commit/de4ea2d51262d86f8806fbb710c6b3ae14b24c7f) fix: `value` is required when parameter is of type `enum` (#9753) + * [2312cc9ca](https://github.com/argoproj/argo-workflows/commit/2312cc9ca4f26f06ccc107a10013ea903c10ec15) Revert "Add --tls-certificate-secret-name parameter to server command. Fixes #5582" (#9756) + * [d9d1968de](https://github.com/argoproj/argo-workflows/commit/d9d1968de80fa0ee19a5e46ceea5d2b4cf4b5475) fix: node links on UI use podName instead of workflow name (#9740) + * [4fa3d1f37](https://github.com/argoproj/argo-workflows/commit/4fa3d1f37eeec285008e4c23dd50e019c5e41b64) chore(deps-dev): bump @babel/core from 7.19.1 to 7.19.3 in /ui (#9723) + * [cf06067c8](https://github.com/argoproj/argo-workflows/commit/cf06067c898bb87c356fc6fc6d2ba5b203ca5df2) chore(deps-dev): bump @babel/preset-env from 7.19.1 to 7.19.3 in /ui (#9728) + * [b5bef026f](https://github.com/argoproj/argo-workflows/commit/b5bef026ff80bd0c97ffaed51040e59a16c69b66) chore(deps-dev): bump babel-jest from 29.0.3 to 29.1.2 in /ui (#9726) + * [9ac6df02e](https://github.com/argoproj/argo-workflows/commit/9ac6df02e7253df5e0764d6f29bda1ac1bdbb071) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.37 to 7.0.39 (#9721) + * [0b957c128](https://github.com/argoproj/argo-workflows/commit/0b957c1289fd6c04b8c0f63ab18463de9074ac91) chore(deps): bump github.com/argoproj/argo-events from 1.7.2 to 1.7.3 (#9722) + * [e547c72f7](https://github.com/argoproj/argo-workflows/commit/e547c72f7956cb39471f3c523210c79cf05b3775) chore(deps): bump dependabot/fetch-metadata from 1.3.3 to 1.3.4 (#9718) + * [4ba1a0f9b](https://github.com/argoproj/argo-workflows/commit/4ba1a0f9bcfc2a5cd6dd246b4b4635e2d8cecf6d) chore(deps): bump google.golang.org/api from 0.97.0 to 0.98.0 (#9719) + +### Contributors + + * Aditya Shrivastava + * Alex Collins + * Andrii Chubatiuk + * Anil Kumar + * Dillen Padhiar + * Isitha Subasinghe + * Julie Vogelman + * Lukas Heppe + * Ricardo Rosales + * Rohan Kumar + * Saravanan Balasubramanian + * Shadow W + * Takumi Sue + * Tianchu Zhao + * TwiN + * Vũ Hải Lâm + * Yuan Tang + * alexdittmann + * botbotbot + * chen yangxue + * dependabot[bot] + * jibuji + ## v3.4.1 (2022-09-30) -* [365b6df16](https://github.com/argoproj/argo-workflows/commit/365b6df1641217d1b21b77bb1c2fcb41115dd439) fix: Label on Artifact GC Task no longer exceeds max characters (#9686) -* [0851c36d8](https://github.com/argoproj/argo-workflows/commit/0851c36d8638833b9ecfe0125564e5635641846f) fix: Workflow-controller panic when stop a wf using plugin. Fixes #9587 (#9690) -* [2f5e7534c](https://github.com/argoproj/argo-workflows/commit/2f5e7534c44499a9efce51d12ff87f8c3f725a21) fix: ordering of functionality for setting and evaluating label expressions (#9661) -* [4e34979e1](https://github.com/argoproj/argo-workflows/commit/4e34979e1b132439fe1101a23b46e24a62c0368d) chore(deps): bump argo-events to 1.7.2 (#9624) -* [f0016e054](https://github.com/argoproj/argo-workflows/commit/f0016e054ec32505dcd7f7d610443ad380fc6651) fix: Remove LIST_LIMIT in workflow informer (#9700) -* [e08524d2a](https://github.com/argoproj/argo-workflows/commit/e08524d2acbd474f232f958e711d04d8919681e8) fix: Avoid controller crashes when running large number of workflows (#9691) -* [4158cf11a](https://github.com/argoproj/argo-workflows/commit/4158cf11ad2e5837a76d1194a99b38e6d66f7dd0) Adding Splunk as Argo Workflows User (#9697) -* [d553c9186](https://github.com/argoproj/argo-workflows/commit/d553c9186c761da16a641885a6de8f7fdfb42592) chore(deps-dev): bump sass from 1.54.9 to 1.55.0 in /ui (#9675) -* [ff6aab34e](https://github.com/argoproj/argo-workflows/commit/ff6aab34ecbb5c0de26e36108cd1201c1e1ae2f5) Add --tls-certificate-secret-name parameter to server command. Fixes #5582 (#9423) -* [84c19ea90](https://github.com/argoproj/argo-workflows/commit/84c19ea909cbc5249f684133dcb5a8481a533dab) fix: render template vars in DAGTask before releasing lock.. Fixes #9395 (#9405) -* [b214161b3](https://github.com/argoproj/argo-workflows/commit/b214161b38642da75a38a100548d3809731746ff) fix: add authorization from cookie to metadata (#9663) -* [b219d85ab](https://github.com/argoproj/argo-workflows/commit/b219d85ab57092b37b0b26f9f7c4cfbf5a9bea9a) fix: retry ExecutorPlugin invocation on transient network errors Fixes: #9664 (#9665) -* [b96d446d6](https://github.com/argoproj/argo-workflows/commit/b96d446d666f704ba102077404bf0b7c472c1494) fix: Improve semaphore concurrency performance (#9666) -* [38b55e39c](https://github.com/argoproj/argo-workflows/commit/38b55e39cca03e54da1f38849b066b36e03ba240) fix: sh not available in scratch container but used in argoexec. Fixes #9654 (#9679) -* [67fc0acab](https://github.com/argoproj/argo-workflows/commit/67fc0acabc4a03f374195246b362b177893866b1) chore(deps): bump golangci-lint to v1.49.0 (#9639) -* [9d7450139](https://github.com/argoproj/argo-workflows/commit/9d74501395fd715e2eb364e9f011b0224545d9ce) chore(deps-dev): bump webpack-dev-server from 4.11.0 to 4.11.1 in /ui (#9677) -* [56454d0c8](https://github.com/argoproj/argo-workflows/commit/56454d0c8d8d4909e23f0938e561ad2bdb02cef2) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.36 to 7.0.37 (#9673) -* [49c47cbad](https://github.com/argoproj/argo-workflows/commit/49c47cbad0408adaf1371da36c3ece340fdecd65) chore(deps): bump cloud.google.com/go/storage from 1.26.0 to 1.27.0 (#9672) -* [e6eb02fb5](https://github.com/argoproj/argo-workflows/commit/e6eb02fb529b7952227dcef091853edcf20f8248) fix: broken archived workflows ui. Fixes #9614, #9433 (#9634) -* [e556fe3eb](https://github.com/argoproj/argo-workflows/commit/e556fe3eb355bf9ef31a1ef8b057c680a5c24f06) fix: Fixed artifact retrieval when templateRef in use. Fixes #9631, #9644. (#9648) -* [72d3599b9](https://github.com/argoproj/argo-workflows/commit/72d3599b9f75861414475a39950879bddbc4e154) fix: avoid panic when not passing AuthSupplier (#9586) -* [4e430ecd8](https://github.com/argoproj/argo-workflows/commit/4e430ecd88d26c89b0fa38b7962d40dd09e9695e) chore(deps-dev): bump @babel/preset-env from 7.19.0 to 7.19.1 in /ui (#9605) -* [4ab943528](https://github.com/argoproj/argo-workflows/commit/4ab943528c8e1b510549e9c860c03adb8893e96b) chore(deps): bump google.golang.org/api from 0.95.0 to 0.96.0 (#9600) -* [7d3432899](https://github.com/argoproj/argo-workflows/commit/7d3432899890a84a2e745932a2f88ef53e75282a) chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 in /ui (#9604) - -### Contributors - -* Adam -* Brian Loss -* Dakota Lillie -* Jesse Suen -* Julie Vogelman -* Rohan Kumar -* Seokju Hong -* Takumi Sue -* Vladimir Ivanov -* William Van Hevelingen -* Yuan Tang -* chen yangxue -* dependabot[bot] -* emagana -* jsvk + * [365b6df16](https://github.com/argoproj/argo-workflows/commit/365b6df1641217d1b21b77bb1c2fcb41115dd439) fix: Label on Artifact GC Task no longer exceeds max characters (#9686) + * [0851c36d8](https://github.com/argoproj/argo-workflows/commit/0851c36d8638833b9ecfe0125564e5635641846f) fix: Workflow-controller panic when stop a wf using plugin. Fixes #9587 (#9690) + * [2f5e7534c](https://github.com/argoproj/argo-workflows/commit/2f5e7534c44499a9efce51d12ff87f8c3f725a21) fix: ordering of functionality for setting and evaluating label expressions (#9661) + * [4e34979e1](https://github.com/argoproj/argo-workflows/commit/4e34979e1b132439fe1101a23b46e24a62c0368d) chore(deps): bump argo-events to 1.7.2 (#9624) + * [f0016e054](https://github.com/argoproj/argo-workflows/commit/f0016e054ec32505dcd7f7d610443ad380fc6651) fix: Remove LIST_LIMIT in workflow informer (#9700) + * [e08524d2a](https://github.com/argoproj/argo-workflows/commit/e08524d2acbd474f232f958e711d04d8919681e8) fix: Avoid controller crashes when running large number of workflows (#9691) + * [4158cf11a](https://github.com/argoproj/argo-workflows/commit/4158cf11ad2e5837a76d1194a99b38e6d66f7dd0) Adding Splunk as Argo Workflows User (#9697) + * [d553c9186](https://github.com/argoproj/argo-workflows/commit/d553c9186c761da16a641885a6de8f7fdfb42592) chore(deps-dev): bump sass from 1.54.9 to 1.55.0 in /ui (#9675) + * [ff6aab34e](https://github.com/argoproj/argo-workflows/commit/ff6aab34ecbb5c0de26e36108cd1201c1e1ae2f5) Add --tls-certificate-secret-name parameter to server command. Fixes #5582 (#9423) + * [84c19ea90](https://github.com/argoproj/argo-workflows/commit/84c19ea909cbc5249f684133dcb5a8481a533dab) fix: render template vars in DAGTask before releasing lock.. Fixes #9395 (#9405) + * [b214161b3](https://github.com/argoproj/argo-workflows/commit/b214161b38642da75a38a100548d3809731746ff) fix: add authorization from cookie to metadata (#9663) + * [b219d85ab](https://github.com/argoproj/argo-workflows/commit/b219d85ab57092b37b0b26f9f7c4cfbf5a9bea9a) fix: retry ExecutorPlugin invocation on transient network errors Fixes: #9664 (#9665) + * [b96d446d6](https://github.com/argoproj/argo-workflows/commit/b96d446d666f704ba102077404bf0b7c472c1494) fix: Improve semaphore concurrency performance (#9666) + * [38b55e39c](https://github.com/argoproj/argo-workflows/commit/38b55e39cca03e54da1f38849b066b36e03ba240) fix: sh not available in scratch container but used in argoexec. Fixes #9654 (#9679) + * [67fc0acab](https://github.com/argoproj/argo-workflows/commit/67fc0acabc4a03f374195246b362b177893866b1) chore(deps): bump golangci-lint to v1.49.0 (#9639) + * [9d7450139](https://github.com/argoproj/argo-workflows/commit/9d74501395fd715e2eb364e9f011b0224545d9ce) chore(deps-dev): bump webpack-dev-server from 4.11.0 to 4.11.1 in /ui (#9677) + * [56454d0c8](https://github.com/argoproj/argo-workflows/commit/56454d0c8d8d4909e23f0938e561ad2bdb02cef2) chore(deps): bump github.com/minio/minio-go/v7 from 7.0.36 to 7.0.37 (#9673) + * [49c47cbad](https://github.com/argoproj/argo-workflows/commit/49c47cbad0408adaf1371da36c3ece340fdecd65) chore(deps): bump cloud.google.com/go/storage from 1.26.0 to 1.27.0 (#9672) + * [e6eb02fb5](https://github.com/argoproj/argo-workflows/commit/e6eb02fb529b7952227dcef091853edcf20f8248) fix: broken archived workflows ui. Fixes #9614, #9433 (#9634) + * [e556fe3eb](https://github.com/argoproj/argo-workflows/commit/e556fe3eb355bf9ef31a1ef8b057c680a5c24f06) fix: Fixed artifact retrieval when templateRef in use. Fixes #9631, #9644. (#9648) + * [72d3599b9](https://github.com/argoproj/argo-workflows/commit/72d3599b9f75861414475a39950879bddbc4e154) fix: avoid panic when not passing AuthSupplier (#9586) + * [4e430ecd8](https://github.com/argoproj/argo-workflows/commit/4e430ecd88d26c89b0fa38b7962d40dd09e9695e) chore(deps-dev): bump @babel/preset-env from 7.19.0 to 7.19.1 in /ui (#9605) + * [4ab943528](https://github.com/argoproj/argo-workflows/commit/4ab943528c8e1b510549e9c860c03adb8893e96b) chore(deps): bump google.golang.org/api from 0.95.0 to 0.96.0 (#9600) + * [7d3432899](https://github.com/argoproj/argo-workflows/commit/7d3432899890a84a2e745932a2f88ef53e75282a) chore(deps-dev): bump babel-jest from 29.0.2 to 29.0.3 in /ui (#9604) + +### Contributors + + * Adam + * Brian Loss + * Dakota Lillie + * Jesse Suen + * Julie Vogelman + * Rohan Kumar + * Seokju Hong + * Takumi Sue + * Vladimir Ivanov + * William Van Hevelingen + * Yuan Tang + * chen yangxue + * dependabot[bot] + * emagana + * jsvk ## v3.4.0 (2022-09-18) From 6b086368f6480a2de5e2d43eec73514de0ad01ac Mon Sep 17 00:00:00 2001 From: Saravanan Balasubramanian <33908564+sarabala1979@users.noreply.github.com> Date: Sun, 23 Oct 2022 08:56:20 -0700 Subject: [PATCH 02/13] fix: Mutex is not initialized when controller restart (#9873) Signed-off-by: Saravanan Balasubramanian --- workflow/controller/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workflow/controller/controller.go b/workflow/controller/controller.go index 66b66f9f5c5f..0158b5751bfb 100644 --- a/workflow/controller/controller.go +++ b/workflow/controller/controller.go @@ -370,11 +370,12 @@ func (wfc *WorkflowController) initManagers(ctx context.Context) error { return err } + wfc.syncManager.Initialize(wfList.Items) + if err := wfc.throttler.Init(wfList.Items); err != nil { return err } - wfc.syncManager.Initialize(wfList.Items) return nil } From ff3133fb7d049c3d239522ac37f153b69d76b028 Mon Sep 17 00:00:00 2001 From: Eddie Knight Date: Sat, 29 Oct 2022 00:56:09 -0400 Subject: [PATCH 03/13] Moved elevated permissions to job level (#9917) Signed-off-by: Eddie Knight --- .github/workflows/dependabot-reviewer.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependabot-reviewer.yml b/.github/workflows/dependabot-reviewer.yml index 5ef791341ebb..0e4f2794de69 100644 --- a/.github/workflows/dependabot-reviewer.yml +++ b/.github/workflows/dependabot-reviewer.yml @@ -3,12 +3,14 @@ name: Approve and enable auto-merge for dependabot on: pull_request permissions: - pull-requests: write - contents: write + contents: read jobs: review: runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: write if: ${{ github.actor == 'dependabot[bot]' && github.repository == 'argoproj/argo-workflows'}} steps: - name: Dependabot metadata From b1c78de0868f5588b01122de08fd5d3bb24faa22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Max=20G=C3=B6rner?= <5477952+MaxG87@users.noreply.github.com> Date: Sat, 29 Oct 2022 06:57:01 +0200 Subject: [PATCH 04/13] Remove wrong braces in documentation (#9903) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Max Görner <5477952+MaxG87@users.noreply.github.com> --- docs/running-locally.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/running-locally.md b/docs/running-locally.md index 6472d1719b5c..fc7a997d47d0 100644 --- a/docs/running-locally.md +++ b/docs/running-locally.md @@ -7,7 +7,7 @@ You have two options: ## Git Clone -Clone the Git repo into: `$(GOPATH)/src/github.com/argoproj/argo-workflows`. Any other path will mean the code +Clone the Git repo into: `$GOPATH/src/github.com/argoproj/argo-workflows`. Any other path will mean the code generation does not work. ## Development Container @@ -152,7 +152,7 @@ make start PROFILE=mysql AUTH_MODE=client STATIC_FILES=false API=true If you want to run Azure tests against a local Azurite: ```bash -kubectl -n $(KUBE_NAMESPACE) apply -f test/e2e/azure/deploy-azurite.yaml +kubectl -n $KUBE_NAMESPACE apply -f test/e2e/azure/deploy-azurite.yaml make start ``` @@ -221,7 +221,7 @@ git commit --signoff -m 'feat: Added a new feature. Fixes #1234' * When running `make pre-commit -B`, if you encounter errors like `make: *** [pkg/apiclient/clusterworkflowtemplate/cluster-workflow-template.swagger.json] Error 1`, ensure that you - have checked out your code into `$(GOPATH)/src/github.com/argoproj/argo-workflows`. + have checked out your code into `$GOPATH/src/github.com/argoproj/argo-workflows`. * If you encounter "out of heap" issues when building UI through Docker, please validate resources allocated to Docker. Compilation may fail if allocated RAM is less than 4Gi. From e47db00c23a6a63081773625b866e9d1f1b0ffda Mon Sep 17 00:00:00 2001 From: Tim Collins <45351296+tico24@users.noreply.github.com> Date: Sat, 29 Oct 2022 05:58:00 +0100 Subject: [PATCH 05/13] docs: Reference new Killercoda course (#9910) Signed-off-by: Tim Collins --- .spelling | 1 + docs/quick-start.md | 2 ++ docs/training.md | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/.spelling b/.spelling index 4e90c7203423..c009b517fabf 100644 --- a/.spelling +++ b/.spelling @@ -62,6 +62,7 @@ JetBrains KNative Katacoda Kerberos +Killercoda KubectlExec Kubeflow Kustomize diff --git a/docs/quick-start.md b/docs/quick-start.md index 43c6d7ccffc0..7f7b6af1fff1 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -9,6 +9,8 @@ Before you start you need a Kubernetes cluster and `kubectl` set up to be able t * [k3s](https://k3s.io/) or [k3d](https://k3d.io/) * [Docker Desktop](https://www.docker.com/products/docker-desktop/) +Alternatively, if you want to try out Argo Workflows and don't want to set up a Kubernetes cluster, try the [Killercoda course](training.md#hands-on). + ⚠️ These instructions are intended to help you get started quickly. They are not suitable in production. For production installs, please refer to [the installation documentation](installation.md) ⚠️ ## Install Argo Workflows diff --git a/docs/training.md b/docs/training.md index efe7e56c5405..b80c5f3dd7e8 100644 --- a/docs/training.md +++ b/docs/training.md @@ -6,6 +6,10 @@ We also have a YouTube playlist of videos that includes workshops you can follow [![Videos Screenshot](assets/videos.png) Open the playlist](https://youtube.com/playlist?list=PLGHfqDpnXFXLHfeapfvtt9URtUF1geuBo) +## Hands-On + +We've created [a Killercoda course featuring beginner and intermediate lessons](https://killercoda.com/pipekit/course/argo-workflows/). These allow to you try out Argo Workflows in your web browser without needing to install anything on your computer. Each lesson starts up a Kubernetes cluster that you can access via a web browser. + ## Additional resources Visit the [awesome-argo GitHub repo](https://github.com/terrytangyuan/awesome-argo) for more educational resources. From ad227e0f5608668c81a9841a2a7ea429ea8de637 Mon Sep 17 00:00:00 2001 From: Amit Auddy Date: Sat, 29 Oct 2022 10:35:47 +0530 Subject: [PATCH 06/13] docs: usage of podSpecPatch for large size artifacts Fixes #9525 (#9921) Signed-off-by: awwwd --- docs/walk-through/artifacts.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/walk-through/artifacts.md b/docs/walk-through/artifacts.md index bf8ee1ebfefc..101456da7b4e 100644 --- a/docs/walk-through/artifacts.md +++ b/docs/walk-through/artifacts.md @@ -57,6 +57,31 @@ spec: The `whalesay` template uses the `cowsay` command to generate a file named `/tmp/hello-world.txt`. It then `outputs` this file as an artifact named `hello-art`. In general, the artifact's `path` may be a directory rather than just a file. The `print-message` template takes an input artifact named `message`, unpacks it at the `path` named `/tmp/message` and then prints the contents of `/tmp/message` using the `cat` command. The `artifact-example` template passes the `hello-art` artifact generated as an output of the `generate-artifact` step as the `message` input artifact to the `print-message` step. DAG templates use the tasks prefix to refer to another task, for example `{{tasks.generate-artifact.outputs.artifacts.hello-art}}`. +Optionally, for large artifacts, you can set `podSpecPatch` in the workflow spec to increase the resource request for the init container and avoid any Out of memory issues. + +```yaml +<... snipped ...> + - name: large-artifact + # below patch gets merged with the actual pod spec and increses the memory + # request of the init container. + podSpecPatch: | + initContainers: + - name: init + resources: + requests: + memory: 2Gi + cpu: 300m + inputs: + artifacts: + - name: data + path: /tmp/large-file + container: + image: alpine:latest + command: [sh, -c] + args: ["cat /tmp/large-file"] +<... snipped ...> +``` + Artifacts are packaged as Tarballs and gzipped by default. You may customize this behavior by specifying an archive strategy, using the `archive` field. For example: ```yaml From 1c41dc7154e947caae22615444cb363ae893ace9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 08:47:01 +0000 Subject: [PATCH 07/13] chore(deps): bump google.golang.org/api from 0.99.0 to 0.101.0 (#9927) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 12 ++++++------ go.sum | 23 ++++++++++++----------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/go.mod b/go.mod index 762a6b307b4e..e133843fb889 100644 --- a/go.mod +++ b/go.mod @@ -54,11 +54,11 @@ require ( golang.org/x/exp v0.0.0-20220602145555-4a0574d9293f golang.org/x/net v0.0.0-20221012135044-0b7e1fb9d458 golang.org/x/oauth2 v0.0.0-20221006150949-b44042a4b9c1 - golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 + golang.org/x/sync v0.1.0 golang.org/x/time v0.0.0-20220922220347-f3bd1da661af - google.golang.org/api v0.99.0 - google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e - google.golang.org/grpc v1.50.0 + google.golang.org/api v0.101.0 + google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 + google.golang.org/grpc v1.50.1 gopkg.in/go-playground/webhooks.v5 v5.17.0 gopkg.in/jcmturner/gokrb5.v5 v5.3.0 k8s.io/api v0.24.3 @@ -142,7 +142,7 @@ require ( github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.0 // indirect - github.com/googleapis/gax-go/v2 v2.5.1 // indirect + github.com/googleapis/gax-go/v2 v2.6.0 // indirect github.com/hashicorp/go-uuid v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/huandu/xstrings v1.3.2 // indirect @@ -204,7 +204,7 @@ require ( go.opencensus.io v0.23.0 // indirect golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect - golang.org/x/text v0.3.7 // indirect + golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.28.1 // indirect diff --git a/go.sum b/go.sum index db5296acc820..22c8b52833b1 100644 --- a/go.sum +++ b/go.sum @@ -600,8 +600,8 @@ github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0 github.com/googleapis/gax-go/v2 v2.2.0/go.mod h1:as02EH8zWkzwUoLbBaFeQ+arQaj/OthfcblKl4IGNaM= github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99EXz9pXxye9YM= github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= -github.com/googleapis/gax-go/v2 v2.5.1 h1:kBRZU0PSuI7PspsSb/ChWoVResUcwNVIdpB049pKTiw= -github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= +github.com/googleapis/gax-go/v2 v2.6.0 h1:SXk3ABtQYDT/OH8jAyvEOQ58mgawq5C4o/4/89qN2ZU= +github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= @@ -1403,8 +1403,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0 h1:cu5kTvlzcw1Q5S9f5ip1/cpiB4nXvw1XYzFPGgzLUOY= -golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1525,8 +1525,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1689,8 +1690,8 @@ google.golang.org/api v0.75.0/go.mod h1:pU9QmyHLnzlpar1Mjt4IbapUCy8J+6HD6GeELN69 google.golang.org/api v0.78.0/go.mod h1:1Sg78yoMLOhlQTeF+ARBoytAcH1NNyyl390YMy6rKmw= google.golang.org/api v0.80.0/go.mod h1:xY3nI94gbvBrE0J6NHXhxOmW97HG7Khjkku6AFB3Hyg= google.golang.org/api v0.84.0/go.mod h1:NTsGnUFJMYROtiquksZHBWtHfeMC7iYthki7Eq3pa8o= -google.golang.org/api v0.99.0 h1:tsBtOIklCE2OFxhmcYSVqGwSAN/Y897srxmcvAQnwK8= -google.golang.org/api v0.99.0/go.mod h1:1YOf74vkVndF7pG6hIHuINsM7eWwpVTAfNMNiL91A08= +google.golang.org/api v0.101.0 h1:lJPPeEBIRxGpGLwnBTam1NPEM8Z2BmmXEd3z812pjwM= +google.golang.org/api v0.101.0/go.mod h1:CjxAAWWt3A3VrUE2IGDY2bgK5qhoG/OkyWVlYcP05MY= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1787,8 +1788,8 @@ google.golang.org/genproto v0.0.0-20220518221133-4f43b3371335/go.mod h1:RAyBrSAP google.golang.org/genproto v0.0.0-20220523171625-347a074981d8/go.mod h1:RAyBrSAP7Fh3Nc84ghnVLDPuV51xc9agzmm4Ph6i0Q4= google.golang.org/genproto v0.0.0-20220608133413-ed9918b62aac/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= google.golang.org/genproto v0.0.0-20220616135557-88e70c0c3a90/go.mod h1:KEWEmljWE5zPzLBa/oHl6DaEt9LmfH6WtH1OHIvleBA= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e h1:halCgTFuLWDRD61piiNSxPsARANGD3Xl16hPrLgLiIg= -google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqwhZAwq4wsRUaVG555sVgsNmIjRtO7t/JH29U= +google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55 h1:U1u4KB2kx6KR/aJDjQ97hZ15wQs8ZPvDcGcRynBhkvg= +google.golang.org/genproto v0.0.0-20221018160656-63c7b68cfc55/go.mod h1:45EK0dUbEZ2NHjCeAd2LXmyjAgGUGrpGROgjhC3ADck= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1825,8 +1826,8 @@ google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11 google.golang.org/grpc v1.46.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.46.2/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.50.0 h1:fPVVDxY9w++VjTZsYvXWqEf9Rqar/e+9zYfxKK+W+YU= -google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= +google.golang.org/grpc v1.50.1 h1:DS/BukOZWp8s6p4Dt/tOaJaTQyPyOoCcrjroHuCeLzY= +google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 1c996520411e6e47f1d3b42a3645c943348275af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 29 Oct 2022 09:12:59 +0000 Subject: [PATCH 08/13] chore(deps-dev): bump babel-jest from 29.2.0 to 29.2.2 in /ui (#9930) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- ui/package.json | 2 +- ui/yarn.lock | 66 ++++++++++++++++++++++++------------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/ui/package.json b/ui/package.json index c8b022dbfc4b..a048770237fa 100644 --- a/ui/package.json +++ b/ui/package.json @@ -59,7 +59,7 @@ "@types/react-router-dom": "^4.2.3", "@types/superagent": "^4.1.15", "@types/swagger-ui-react": "^4.11.0", - "babel-jest": "^29.2.0", + "babel-jest": "^29.2.2", "babel-loader": "^8.2.5", "copy-webpack-plugin": "^5.1.2", "copyfiles": "^2.4.1", diff --git a/ui/yarn.lock b/ui/yarn.lock index 0455d91aa49f..dac9d79cdc4a 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -1274,22 +1274,22 @@ source-map "^0.6.1" write-file-atomic "^3.0.0" -"@jest/transform@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.0.tgz#1c55ca549f64810351df999265a29f8ead51be15" - integrity sha512-NXMujGHy+B4DAj4dGnVPD0SIXlR2Z/N8Gp9h3mF66kcIRult1WWqY3/CEIrJcKviNWaFPYhZjCG2L3fteWzcUw== +"@jest/transform@^29.2.2": + version "29.2.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.2.2.tgz#dfc03fc092b31ffea0c55917728e75bfcf8b5de6" + integrity sha512-aPe6rrletyuEIt2axxgdtxljmzH8O/nrov4byy6pDw9S8inIrTV+2PnjyP/oFHMSynzGxJ2s6OHowBNMXp/Jzg== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^29.2.0" + jest-haste-map "^29.2.1" jest-regex-util "^29.2.0" - jest-util "^29.2.0" + jest-util "^29.2.1" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" @@ -1306,10 +1306,10 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@jest/types@^29.2.0": - version "29.2.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.0.tgz#c0d1ef8bc1e4f4b358e7877e34157371e7881b0b" - integrity sha512-mfgpQz4Z2xGo37m6KD8xEpKelaVzvYVRijmLPePn9pxgaPEtX+SqIyPNzzoeCPXKYbB4L/wYSgXDL8o3Gop78Q== +"@jest/types@^29.2.1": + version "29.2.1" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.2.1.tgz#ec9c683094d4eb754e41e2119d8bdaef01cf6da0" + integrity sha512-O/QNDQODLnINEPAI0cl9U6zUIDXEWXt6IC1o2N2QENuos7hlGUIthlKyV4p6ki3TvXFX071blj8HUhgLGquPjw== dependencies: "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" @@ -2417,12 +2417,12 @@ babel-jest@^26.6.3: graceful-fs "^4.2.4" slash "^3.0.0" -babel-jest@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.0.tgz#088624f037da90e69a06073305276cbd111d68a8" - integrity sha512-c8FkrW1chgcbyBqOo7jFGpQYfVnb43JqjQGV+C2r94k2rZJOukYOZ6+csAqKE4ms+PHc+yevnONxs27jQIxylw== +babel-jest@^29.2.2: + version "29.2.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.2.2.tgz#2c15abd8c2081293c9c3f4f80a4ed1d51542fee5" + integrity sha512-kkq2QSDIuvpgfoac3WZ1OOcHsQQDU5xYk2Ql7tLdJ8BVAYbefEXal+NfS45Y5LVZA7cxC8KYcQMObpCt1J025w== dependencies: - "@jest/transform" "^29.2.0" + "@jest/transform" "^29.2.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" babel-preset-jest "^29.2.0" @@ -5690,20 +5690,20 @@ jest-haste-map@^26.6.2: optionalDependencies: fsevents "^2.1.2" -jest-haste-map@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.0.tgz#2410f2ec93958e0bd894818de6c8056eb1b4d6fc" - integrity sha512-qu9lGFi7qJ8v37egS1phZZUJYiMyWnKwu83NlNT1qs50TbedIX2hFl+9ztsJ7U/ENaHwk1/Bs8fqOIQsScIRwg== +jest-haste-map@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.2.1.tgz#f803fec57f8075e6c55fb5cd551f99a72471c699" + integrity sha512-wF460rAFmYc6ARcCFNw4MbGYQjYkvjovb9GBT+W10Um8q5nHq98jD6fHZMDMO3tA56S8XnmNkM8GcA8diSZfnA== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" jest-regex-util "^29.2.0" - jest-util "^29.2.0" - jest-worker "^29.2.0" + jest-util "^29.2.1" + jest-worker "^29.2.1" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: @@ -5913,12 +5913,12 @@ jest-util@^26.1.0, jest-util@^26.6.2: is-ci "^2.0.0" micromatch "^4.0.2" -jest-util@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.0.tgz#797935697e83a5722aeba401ed6cd01264295566" - integrity sha512-8M1dx12ujkBbnhwytrezWY0Ut79hbflwodE+qZKjxSRz5qt4xDp6dQQJaOCFvCmE0QJqp9KyEK33lpPNjnhevw== +jest-util@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.2.1.tgz#f26872ba0dc8cbefaba32c34f98935f6cf5fc747" + integrity sha512-P5VWDj25r7kj7kl4pN2rG/RN2c1TLfYYYZYULnS/35nFDjBai+hBeo3MDrYZS7p6IoY3YHZnt2vq4L6mKnLk0g== dependencies: - "@jest/types" "^29.2.0" + "@jest/types" "^29.2.1" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" @@ -5959,13 +5959,13 @@ jest-worker@^26.6.2: merge-stream "^2.0.0" supports-color "^7.0.0" -jest-worker@^29.2.0: - version "29.2.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.0.tgz#b2bd1a81fc7a1ae79a500b05f5feb0d1c0b1a19e" - integrity sha512-mluOlMbRX1H59vGVzPcVg2ALfCausbBpxC8a2KWOzInhYHZibbHH8CB0C1JkmkpfurrkOYgF7FPmypuom1OM9A== +jest-worker@^29.2.1: + version "29.2.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.2.1.tgz#8ba68255438252e1674f990f0180c54dfa26a3b1" + integrity sha512-ROHTZ+oj7sBrgtv46zZ84uWky71AoYi0vEV9CdEtc1FQunsoAGe5HbQmW76nI5QWdvECVPrSi1MCVUmizSavMg== dependencies: "@types/node" "*" - jest-util "^29.2.0" + jest-util "^29.2.1" merge-stream "^2.0.0" supports-color "^8.0.0" From 30a6d5eb73f1197380df4b904eed2646dfb3b4aa Mon Sep 17 00:00:00 2001 From: Ryan Copley Date: Sat, 29 Oct 2022 11:46:46 -0400 Subject: [PATCH 09/13] feat: Include node.name as a field for interpolation (#9641) Signed-off-by: Ryan Copley Signed-off-by: Ryan Copley Co-authored-by: Saravanan Balasubramanian <33908564+sarabala1979@users.noreply.github.com> --- docs/variables.md | 1 + workflow/controller/operator.go | 3 ++ workflow/controller/operator_test.go | 52 ++++++++++++++++++++++++++++ workflow/validate/validate.go | 1 + workflow/validate/validate_test.go | 33 ++++++++++++++++++ 5 files changed, 90 insertions(+) diff --git a/docs/variables.md b/docs/variables.md index f1234e0faff0..bf7a2f334848 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -130,6 +130,7 @@ returns `0`. Please review the Sprig documentation to understand which functions | `inputs.parameters.`| Input parameter to a template | | `inputs.parameters`| All input parameters to a template as a JSON string | | `inputs.artifacts.` | Input artifact to a template | +| `node.name` | Full name of the node | ### Steps Templates diff --git a/workflow/controller/operator.go b/workflow/controller/operator.go index db6031509dca..933b9db9f433 100644 --- a/workflow/controller/operator.go +++ b/workflow/controller/operator.go @@ -1735,6 +1735,9 @@ func (woc *wfOperationCtx) executeTemplate(ctx context.Context, nodeName string, if orgTmpl.IsWorkflowStep() { localParams["steps.name"] = orgTmpl.GetName() } + + localParams["node.name"] = nodeName + // Merge Template defaults to template err = woc.mergedTemplateDefaultsInto(resolvedTmpl) if err != nil { diff --git a/workflow/controller/operator_test.go b/workflow/controller/operator_test.go index 2ccff2a0623e..92e0a0525e80 100644 --- a/workflow/controller/operator_test.go +++ b/workflow/controller/operator_test.go @@ -6608,6 +6608,58 @@ func TestWorkflowScheduledTimeVariable(t *testing.T) { assert.Equal(t, "2006-01-02T15:04:05-07:00", woc.globalParams[common.GlobalVarWorkflowCronScheduleTime]) } +var wfNodeNameField = ` +apiVersion: argoproj.io/v1alpha1 +kind: Workflow +metadata: + name: hello-world +spec: + entrypoint: main + templates: + - name: main + dag: + tasks: + - name: this-is-part-1 + template: main2 + - name: main2 + steps: + - - name: this-is-part-2 + template: whalesay + arguments: + parameters: + - name: message + value: "{{node.name}}" + - name: whalesay + inputs: + parameters: + - name: message + container: + image: docker/whalesay:latest + command: [cowsay] + args: ["{{ inputs.parameters.message }}"] +` + +func TestWorkflowInterpolatesNodeNameField(t *testing.T) { + wf := wfv1.MustUnmarshalWorkflow(wfNodeNameField) + cancel, controller := newController(wf) + defer cancel() + + ctx := context.Background() + woc := newWorkflowOperationCtx(wf, controller) + woc.operate(ctx) + + foundPod := false + for _, element := range woc.wf.Status.Nodes { + if element.Type == "Pod" { + foundPod = true + assert.Equal(t, "hello-world.this-is-part-1", element.Inputs.Parameters[0].Value.String()) + } + } + + assert.True(t, foundPod) + +} + func TestWorkflowShutdownStrategy(t *testing.T) { wf := wfv1.MustUnmarshalWorkflow(` apiVersion: argoproj.io/v1alpha1 diff --git a/workflow/validate/validate.go b/workflow/validate/validate.go index f525339970c0..b53def2e9f76 100644 --- a/workflow/validate/validate.go +++ b/workflow/validate/validate.go @@ -610,6 +610,7 @@ func resolveAllVariables(scope map[string]interface{}, globalParams map[string]s } else if strings.HasPrefix(tag, common.GlobalVarWorkflowDuration) { } else if strings.HasPrefix(tag, "tasks.name") { } else if strings.HasPrefix(tag, "steps.name") { + } else if strings.HasPrefix(tag, "node.name") { } else if strings.HasPrefix(tag, "workflow.parameters") && workflowTemplateValidation { // If we are simply validating a WorkflowTemplate in isolation, some of the parameters may come from the Workflow that uses it } else { diff --git a/workflow/validate/validate_test.go b/workflow/validate/validate_test.go index 5b6c89b762a9..b224f8624f8f 100644 --- a/workflow/validate/validate_test.go +++ b/workflow/validate/validate_test.go @@ -3018,6 +3018,39 @@ func TestInitContainerHasName(t *testing.T) { assert.EqualError(t, err, "templates.main.tasks.spurious initContainers must all have container name") } +var nodeNamePlumbsCorrectly = ` +apiVersion: argoproj.io/v1alpha1 +kind: Workflow +metadata: + generateName: hello-world- +spec: + entrypoint: main + templates: + - name: main + dag: + tasks: + - name: this-is-part-1 + template: main2 + - name: main2 + steps: + - - name: this-is-part-2 + template: main3 + - name: main3 + dag: + tasks: + - name: this-is-part-3 + template: whalesay + - name: whalesay + container: + image: docker/whalesay:latest + command: [cowsay] + args: ["{{ node.name }}"]` + +func TestNodeNameParameterInterpoliates(t *testing.T) { + err := validate(nodeNamePlumbsCorrectly) + assert.NoError(t, err) +} + func TestSubstituteGlobalVariablesLabelsAnnotations(t *testing.T) { tests := []struct { name string From 333dc469edd9a9cf013900a0c221170e247aad21 Mon Sep 17 00:00:00 2001 From: maozhi <765177543@qq.com> Date: Sat, 29 Oct 2022 23:53:59 +0800 Subject: [PATCH 10/13] docs: explain why maxCharsInObjectName is 63 characters (#9915) Signed-off-by: Mzhiing <765177543@qq.com> Co-authored-by: erichmao --- workflow/validate/validate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflow/validate/validate.go b/workflow/validate/validate.go index b53def2e9f76..e41c43070095 100644 --- a/workflow/validate/validate.go +++ b/workflow/validate/validate.go @@ -83,7 +83,9 @@ const ( anyItemMagicValue = "item.*" anyWorkflowOutputParameterMagicValue = "workflow.outputs.parameters.*" anyWorkflowOutputArtifactMagicValue = "workflow.outputs.artifacts.*" - maxCharsInObjectName = 63 + // The maximum length of maxCharsInObjectName is 63 characters because of the limitation of Kubernetes label + // For details, please refer to: https://stackoverflow.com/questions/50412837/kubernetes-label-name-63-character-limit + maxCharsInObjectName = 63 // CronWorkflows have fewer max chars allowed in their name because when workflows are created from them, they // are appended with the unix timestamp (`-1615836720`). This lower character allowance allows for that timestamp // to still fit within the 63 character maximum. From a315765769867a1e7528f253f7e94bbb5291df7b Mon Sep 17 00:00:00 2001 From: Tianchu Zhao Date: Sat, 29 Oct 2022 23:57:28 +0800 Subject: [PATCH 11/13] refactor: ui, convert cluster workflow template to functional component (#9809) Signed-off-by: Tianchu Zhao --- .../cluster-workflow-template-list.tsx | 121 ++++++++---------- 1 file changed, 56 insertions(+), 65 deletions(-) diff --git a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx b/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx index 9980096def72..5ef0fbfa3a19 100644 --- a/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx +++ b/ui/src/app/cluster-workflow-templates/components/cluster-workflow-template-list/cluster-workflow-template-list.tsx @@ -1,90 +1,59 @@ import {Page, SlidingPanel} from 'argo-ui'; import * as React from 'react'; +import {useContext, useEffect, useState} from 'react'; import {Link, RouteComponentProps} from 'react-router-dom'; import * as models from '../../../../models'; import {uiUrl} from '../../../shared/base'; -import {BasePage} from '../../../shared/components/base-page'; import {ErrorNotice} from '../../../shared/components/error-notice'; import {ExampleManifests} from '../../../shared/components/example-manifests'; import {InfoIcon} from '../../../shared/components/fa-icons'; import {Loading} from '../../../shared/components/loading'; import {Timestamp} from '../../../shared/components/timestamp'; import {ZeroState} from '../../../shared/components/zero-state'; -import {Consumer} from '../../../shared/context'; +import {Context} from '../../../shared/context'; +import {useQueryParams} from '../../../shared/use-query-params'; + import {Footnote} from '../../../shared/footnote'; import {services} from '../../../shared/services'; import {ClusterWorkflowTemplateCreator} from '../cluster-workflow-template-creator'; - require('./cluster-workflow-template-list.scss'); -interface State { - templates?: models.ClusterWorkflowTemplate[]; - error?: Error; -} - -export class ClusterWorkflowTemplateList extends BasePage, State> { - private get sidePanel() { - return this.queryParam('sidePanel'); - } +export const ClusterWorkflowTemplateList = ({history, location}: RouteComponentProps) => { + const {navigation} = useContext(Context); + const queryParams = new URLSearchParams(location.search); + const [templates, setTemplates] = useState(); + const [error, setError] = useState(); + const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel')); - private set sidePanel(sidePanel) { - this.setQueryParams({sidePanel}); - } + const fetchClusterWorkflowTemplates = () => { + services.clusterWorkflowTemplate + .list() + .then(retrievedTemplates => setTemplates(retrievedTemplates)) + .then(() => setError(null)) + .catch(setError); + }; - constructor(props: RouteComponentProps, context: any) { - super(props, context); - this.state = {}; - } + useEffect( + useQueryParams(history, p => { + setSidePanel(p.get('sidePanel')); + }), + [history] + ); - public componentDidMount(): void { - this.fetchClusterWorkflowTemplates(); + useEffect(() => { + fetchClusterWorkflowTemplates(); services.info.collectEvent('openedClusterWorkflowTemplateList').then(); - } - - public render() { - return ( - - {ctx => ( - (this.sidePanel = 'new') - } - ] - } - }}> - {this.renderTemplates()} - (this.sidePanel = null)}> - ctx.navigation.goto(uiUrl(`cluster-workflow-templates/${wf.metadata.name}`))} /> - - - )} - - ); - } - - private fetchClusterWorkflowTemplates(): void { - services.clusterWorkflowTemplate - .list() - .then(templates => this.setState({error: null, templates})) - .catch(error => this.setState({error})); - } + }, []); - private renderTemplates() { - if (this.state.error) { - return ; + const renderTemplates = () => { + if (error) { + return ; } - if (!this.state.templates) { + if (!templates) { return ; } const learnMore = Learn more; - if (this.state.templates.length === 0) { + if (templates.length === 0) { return (

You can create new templates here or using the CLI.

@@ -102,7 +71,7 @@ export class ClusterWorkflowTemplateList extends BasePageNAME
CREATED
- {this.state.templates.map(t => ( + {templates.map(t => (
@@ -119,5 +88,27 @@ export class ClusterWorkflowTemplateList extends BasePage ); - } -} + }; + + return ( + setSidePanel('new') + } + ] + } + }}> + {renderTemplates()} + setSidePanel(null)}> + navigation.goto(uiUrl(`cluster-workflow-templates/${wf.metadata.name}`))} /> + + + ); +}; From d612d5d9b983a3cc7436d1c9a94dedb4382f6a9a Mon Sep 17 00:00:00 2001 From: Tianchu Zhao Date: Sun, 30 Oct 2022 00:32:53 +0800 Subject: [PATCH 12/13] feat(ui): view artifact in archiveworkflow. Fixes #9627 #9772 #9858 (#9836) Signed-off-by: Tianchu Zhao Co-authored-by: Alex Collins --- .../archived-workflow-details.tsx | 396 +++++++++--------- .../workflow-details/workflow-details.tsx | 13 +- .../workflow-logs-viewer.tsx | 5 +- .../workflow-node-info/workflow-node-info.tsx | 5 +- 4 files changed, 196 insertions(+), 223 deletions(-) diff --git a/ui/src/app/archived-workflows/components/archived-workflow-details/archived-workflow-details.tsx b/ui/src/app/archived-workflows/components/archived-workflow-details/archived-workflow-details.tsx index c776b845daea..c0a62b8d9df2 100644 --- a/ui/src/app/archived-workflows/components/archived-workflow-details/archived-workflow-details.tsx +++ b/ui/src/app/archived-workflows/components/archived-workflow-details/archived-workflow-details.tsx @@ -1,18 +1,23 @@ import {NotificationType, Page, SlidingPanel} from 'argo-ui'; import * as classNames from 'classnames'; import * as React from 'react'; +import {useContext, useEffect, useState} from 'react'; import {RouteComponentProps} from 'react-router'; -import {execSpec, Link, NodePhase, Workflow} from '../../../../models'; +import {ArtifactRepository, execSpec, Link, Workflow} from '../../../../models'; +import {artifactRepoHasLocation, findArtifact} from '../../../shared/artifacts'; import {uiUrl} from '../../../shared/base'; -import {BasePage} from '../../../shared/components/base-page'; import {ErrorNotice} from '../../../shared/components/error-notice'; import {ProcessURL} from '../../../shared/components/links'; import {Loading} from '../../../shared/components/loading'; +import {Context} from '../../../shared/context'; import {services} from '../../../shared/services'; +import {useQueryParams} from '../../../shared/use-query-params'; import {WorkflowArtifacts} from '../../../workflows/components/workflow-artifacts'; import {ANNOTATION_KEY_POD_NAME_VERSION} from '../../../shared/annotations'; import {getPodName, getTemplateNameFromNode} from '../../../shared/pod-name'; +import {getResolvedTemplates} from '../../../shared/template-resolution'; +import {ArtifactPanel} from '../../../workflows/components/workflow-details/artifact-panel'; import {WorkflowResourcePanel} from '../../../workflows/components/workflow-details/workflow-resource-panel'; import {WorkflowLogsViewer} from '../../../workflows/components/workflow-logs-viewer/workflow-logs-viewer'; import {WorkflowNodeInfo} from '../../../workflows/components/workflow-node-info/workflow-node-info'; @@ -27,293 +32,204 @@ require('../../../workflows/components/workflow-details/workflow-details.scss'); const STEP_GRAPH_CONTAINER_MIN_WIDTH = 490; const STEP_INFO_WIDTH = 570; -interface State { - workflow?: Workflow; - links?: Link[]; - error?: Error; -} +export const ArchivedWorkflowDetails = ({history, location, match}: RouteComponentProps) => { + const ctx = useContext(Context); + const queryParams = new URLSearchParams(location.search); + const [workflow, setWorkflow] = useState(); + const [links, setLinks] = useState(); + const [error, setError] = useState(); -export class ArchivedWorkflowDetails extends BasePage, State> { - private get namespace() { - return this.props.match.params.namespace; - } - - private get uid() { - return this.props.match.params.uid; - } - - private get tab() { - return this.queryParam('tab') || 'workflow'; - } - - private set tab(tab) { - this.setQueryParams({tab}); - } - - private get nodeId() { - return this.queryParam('nodeId'); - } - - private set nodeId(nodeId) { - this.setQueryParams({nodeId}); - } - - private get container() { - return this.queryParam('container') || 'main'; - } - - private get sidePanel() { - return this.queryParam('sidePanel'); - } + const [namespace] = useState(match.params.namespace); + const [uid] = useState(match.params.uid); + const [tab, setTab] = useState(queryParams.get('tab') || 'workflow'); + const [nodeId, setNodeId] = useState(queryParams.get('nodeId')); + const [container, setContainer] = useState(queryParams.get('container') || 'main'); + const [sidePanel, setSidePanel] = useState(queryParams.get('sidePanel')); + const selectedArtifact = workflow && workflow.status && findArtifact(workflow.status, nodeId); + const [selectedTemplateArtifactRepo, setSelectedTemplateArtifactRepo] = useState(); + const node = nodeId && workflow.status.nodes[nodeId]; - private set sidePanel(sidePanel) { - this.setQueryParams({sidePanel}); - } + const podName = () => { + if (nodeId && workflow) { + const workflowName = workflow.metadata.name; + const annotations = workflow.metadata.annotations || {}; + const version = annotations[ANNOTATION_KEY_POD_NAME_VERSION]; + const templateName = getTemplateNameFromNode(node); + return getPodName(workflowName, node.name, templateName, nodeId, version); + } + }; - constructor(props: RouteComponentProps, context: any) { - super(props, context); - this.state = {}; - } + useEffect( + useQueryParams(history, p => { + setSidePanel(p.get('sidePanel')); + setNodeId(p.get('nodeId')); + setContainer(p.get('container')); + }), + [history] + ); - public componentDidMount(): void { + useEffect(() => { services.info .getInfo() - .then(info => this.setState({links: info.links})) + .then(info => setLinks(info.links)) .then(() => - services.archivedWorkflows.get(this.uid).then(workflow => - this.setState({ - error: null, - workflow - }) - ) + services.archivedWorkflows.get(uid).then(retrievedWorkflow => { + setError(null); + setWorkflow(retrievedWorkflow); + }) ) - .catch(error => this.setState({error})); + .catch(newError => setError(newError)); services.info.collectEvent('openedArchivedWorkflowDetails').then(); - } + }, []); - public render() { - const workflowPhase: NodePhase = this.state.workflow && this.state.workflow.status ? this.state.workflow.status.phase : undefined; - const items = [ - { - title: 'Retry', - iconClassName: 'fa fa-undo', - disabled: workflowPhase === undefined || !(workflowPhase === 'Failed' || workflowPhase === 'Error'), - action: () => this.retryArchivedWorkflow() - }, - { - title: 'Resubmit', - iconClassName: 'fa fa-plus-circle', - disabled: false, - action: () => this.resubmitArchivedWorkflow() - }, - { - title: 'Delete', - iconClassName: 'fa fa-trash', - disabled: false, - action: () => this.deleteArchivedWorkflow() + useEffect(() => { + // update the default Artifact Repository for the Template that corresponds to the selectedArtifact + // if there's an ArtifactLocation configured for the Template we use that + // otherwise we use the central one for the Workflow configured in workflow.status.artifactRepositoryRef.artifactRepository + // (Note that individual Artifacts may also override whatever this gets set to) + if (workflow?.status?.nodes && selectedArtifact) { + const template = getResolvedTemplates(workflow, workflow.status.nodes[selectedArtifact.nodeId]); + const artifactRepo = template?.archiveLocation; + if (artifactRepo && artifactRepoHasLocation(artifactRepo)) { + setSelectedTemplateArtifactRepo(artifactRepo); + } else { + setSelectedTemplateArtifactRepo(workflow.status.artifactRepositoryRef.artifactRepository); } - ]; - if (this.state.links) { - this.state.links - .filter(link => link.scope === 'workflow') - .forEach(link => - items.push({ - title: link.name, - iconClassName: 'fa fa-external-link-alt', - disabled: false, - action: () => this.openLink(link) - }) - ); } - return ( - - (this.tab = 'summary')}> - - - (this.tab = 'timeline')}> - - - (this.tab = 'workflow')}> - - -
- ) - }}> -
{this.renderArchivedWorkflowDetails()}
- - ); - } + }, [workflow, selectedArtifact]); - private renderArchivedWorkflowDetails() { - if (this.state.error) { - return ; + const renderArchivedWorkflowDetails = () => { + if (error) { + return ; } - if (!this.state.workflow) { + if (!workflow) { return ; } return ( <> - {this.tab === 'summary' ? ( + {tab === 'summary' ? (
- - {execSpec(this.state.workflow).arguments && execSpec(this.state.workflow).arguments.parameters && ( + + {execSpec(workflow).arguments && execSpec(workflow).arguments.parameters && (
Parameters
- +
)}
Artifacts
- - + +
) : (
- {this.tab === 'workflow' ? ( + {tab === 'workflow' ? ( (this.nodeId = nodeId)} + workflowMetadata={workflow.metadata} + workflowStatus={workflow.status} + selectedNodeId={nodeId} + nodeClicked={newNodeId => setNodeId(newNodeId)} /> ) : ( - (this.nodeId = node.id)} /> + setNodeId(newNode.id)} /> )}
- {this.nodeId && ( + {nodeId && (
- - - this.setQueryParams({ - sidePanel: 'yaml', - nodeId - }) - } - onShowContainerLogs={(nodeId, container) => - this.setQueryParams({ - sidePanel: 'logs', - nodeId, - container - }) - } - archived={true} - /> + {node && ( + { + setSidePanel('yaml'); + setNodeId(newNodeId); + }} + onShowContainerLogs={(newNodeId, newContainer) => { + setSidePanel('logs'); + setNodeId(newNodeId); + setContainer(newContainer); + }} + archived={true} + /> + )} + {selectedArtifact && }
)}
)} - (this.sidePanel = null)}> - {this.sidePanel === 'yaml' && } - {this.sidePanel === 'logs' && ( - - )} + setSidePanel(null)}> + {sidePanel === 'yaml' && } + {sidePanel === 'logs' && } ); - } - - private get node() { - return this.nodeId && this.state.workflow.status.nodes[this.nodeId]; - } + }; - private get podName() { - if (this.nodeId && this.state.workflow) { - const workflowName = this.state.workflow.metadata.name; - let annotations: {[name: string]: string} = {}; - if (typeof this.state.workflow.metadata.annotations !== 'undefined') { - annotations = this.state.workflow.metadata.annotations; - } - const version = annotations[ANNOTATION_KEY_POD_NAME_VERSION]; - const templateName = getTemplateNameFromNode(this.node); - return getPodName(workflowName, this.node.name, templateName, this.nodeId, version); - } - } - - private deleteArchivedWorkflow() { + const deleteArchivedWorkflow = () => { if (!confirm('Are you sure you want to delete this archived workflow?\nThere is no undo.')) { return; } services.archivedWorkflows - .delete(this.uid) + .delete(uid) .then(() => { document.location.href = uiUrl('archived-workflows'); }) .catch(e => { - this.appContext.apis.notifications.show({ + ctx.notifications.show({ content: 'Failed to delete archived workflow ' + e, type: NotificationType.Error }); }); - } + }; - private resubmitArchivedWorkflow() { + const resubmitArchivedWorkflow = () => { if (!confirm('Are you sure you want to resubmit this archived workflow?')) { return; } services.archivedWorkflows - .resubmit(this.state.workflow.metadata.uid, this.state.workflow.metadata.namespace) - .then(workflow => (document.location.href = uiUrl(`workflows/${workflow.metadata.namespace}/${workflow.metadata.name}`))) + .resubmit(workflow.metadata.uid, workflow.metadata.namespace) + .then(newWorkflow => (document.location.href = uiUrl(`workflows/${newWorkflow.metadata.namespace}/${newWorkflow.metadata.name}`))) .catch(e => { - this.appContext.apis.notifications.show({ + ctx.notifications.show({ content: 'Failed to resubmit archived workflow ' + e, type: NotificationType.Error }); }); - } + }; - private retryArchivedWorkflow() { + const retryArchivedWorkflow = () => { if (!confirm('Are you sure you want to retry this archived workflow?')) { return; } services.archivedWorkflows - .retry(this.state.workflow.metadata.uid, this.state.workflow.metadata.namespace) - .then(workflow => (document.location.href = uiUrl(`workflows/${workflow.metadata.namespace}/${workflow.metadata.name}`))) + .retry(workflow.metadata.uid, workflow.metadata.namespace) + .then(newWorkflow => (document.location.href = uiUrl(`workflows/${newWorkflow.metadata.namespace}/${newWorkflow.metadata.name}`))) .catch(e => { - this.appContext.apis.notifications.show({ + ctx.notifications.show({ content: 'Failed to retry archived workflow ' + e, type: NotificationType.Error }); }); - } + }; - private openLink(link: Link) { + const openLink = (link: Link) => { const object = { metadata: { - namespace: this.state.workflow.metadata.namespace, - name: this.state.workflow.metadata.name + namespace: workflow.metadata.namespace, + name: workflow.metadata.name }, - workflow: this.state.workflow, + workflow, status: { - startedAt: this.state.workflow.status.startedAt, - finishedAt: this.state.workflow.status.finishedAt + startedAt: workflow.status.startedAt, + finishedAt: workflow.status.finishedAt } }; const url = ProcessURL(link.url, object); @@ -323,5 +239,75 @@ export class ArchivedWorkflowDetails extends BasePage, } else { document.location.href = url; } + }; + + const workflowPhase = workflow?.status?.phase; + const items = [ + { + title: 'Retry', + iconClassName: 'fa fa-undo', + disabled: workflowPhase === undefined || !(workflowPhase === 'Failed' || workflowPhase === 'Error'), + action: () => retryArchivedWorkflow() + }, + { + title: 'Resubmit', + iconClassName: 'fa fa-plus-circle', + disabled: false, + action: () => resubmitArchivedWorkflow() + }, + { + title: 'Delete', + iconClassName: 'fa fa-trash', + disabled: false, + action: () => deleteArchivedWorkflow() + } + ]; + if (links) { + links + .filter(link => link.scope === 'workflow') + .forEach(link => + items.push({ + title: link.name, + iconClassName: 'fa fa-external-link-alt', + disabled: false, + action: () => openLink(link) + }) + ); } -} + + return ( + + setTab('summary')}> + + + setTab('timeline')}> + + + setTab('workflow')}> + + + + ) + }}> +
{renderArchivedWorkflowDetails()}
+
+ ); +}; diff --git a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx index ae046d7877a8..8e78079043ab 100644 --- a/ui/src/app/workflows/components/workflow-details/workflow-details.tsx +++ b/ui/src/app/workflows/components/workflow-details/workflow-details.tsx @@ -108,13 +108,9 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< // if there's an ArtifactLocation configured for the Template we use that // otherwise we use the central one for the Workflow configured in workflow.status.artifactRepositoryRef.artifactRepository // (Note that individual Artifacts may also override whatever this gets set to) - if (workflow && workflow.status && workflow.status.nodes && selectedArtifact) { + if (workflow?.status?.nodes && selectedArtifact) { const template = getResolvedTemplates(workflow, workflow.status.nodes[selectedArtifact.nodeId]); - let artifactRepo; - if (template) { - artifactRepo = template.archiveLocation; - } - + const artifactRepo = template?.archiveLocation; if (artifactRepo && artifactRepoHasLocation(artifactRepo)) { setSelectedTemplateArtifactRepo(artifactRepo); } else { @@ -389,10 +385,7 @@ export const WorkflowDetails = ({history, location, match}: RouteComponentProps< const ensurePodName = (wf: Workflow, node: NodeStatus, nodeID: string): string => { if (workflow && node) { - let annotations: {[name: string]: string} = {}; - if (typeof workflow.metadata.annotations !== 'undefined') { - annotations = workflow.metadata.annotations; - } + const annotations = workflow.metadata.annotations || {}; const version = annotations[ANNOTATION_KEY_POD_NAME_VERSION]; const templateName = getTemplateNameFromNode(node); return getPodName(wf.metadata.name, node.name, templateName, node.id, version); diff --git a/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx b/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx index c3cec1b17353..faea8d602827 100644 --- a/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx +++ b/ui/src/app/workflows/components/workflow-logs-viewer/workflow-logs-viewer.tsx @@ -65,10 +65,7 @@ export const WorkflowLogsViewer = ({workflow, nodeId, initialPodName, container, return () => clearTimeout(x); }, [logFilter]); - let annotations: {[name: string]: string} = {}; - if (typeof workflow.metadata.annotations !== 'undefined') { - annotations = workflow.metadata.annotations; - } + const annotations = workflow.metadata.annotations || {}; const podNameVersion = annotations[ANNOTATION_KEY_POD_NAME_VERSION]; // map pod names to corresponding node IDs diff --git a/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx b/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx index 0653cbb3f0d8..d5ba22eccdf2 100644 --- a/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx +++ b/ui/src/app/workflows/components/workflow-node-info/workflow-node-info.tsx @@ -100,10 +100,7 @@ const DisplayWorkflowTime = (props: {date: Date | string | number}) => { const WorkflowNodeSummary = (props: Props) => { const {workflow, node} = props; - let annotations: {[name: string]: string} = {}; - if (typeof workflow.metadata.annotations !== 'undefined') { - annotations = workflow.metadata.annotations; - } + const annotations = workflow.metadata.annotations || {}; const version = annotations[ANNOTATION_KEY_POD_NAME_VERSION]; const templateName = getTemplateNameFromNode(node); From 23e3d4d6f646c413d66145ee3e2210ff71eef21d Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Sat, 29 Oct 2022 23:49:47 +0300 Subject: [PATCH 13/13] fix(ui): Apply url encode and decode to a `ProcessURL`. Fixes #9791 (#9912) --- ui/src/app/shared/components/links.test.ts | 12 ++++++++++++ ui/src/app/shared/components/links.tsx | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/ui/src/app/shared/components/links.test.ts b/ui/src/app/shared/components/links.test.ts index b71c9c7dbe61..9124d1487886 100644 --- a/ui/src/app/shared/components/links.test.ts +++ b/ui/src/app/shared/components/links.test.ts @@ -11,6 +11,18 @@ describe('process URL', () => { expect(ProcessURL('https://logging?from=${status.startedAt}&to=${status.finishedAt}', object)).toBe('https://logging?from=2021-01-01T10:30:00Z&to=2021-01-01T10:30:00Z'); }); + test('url encoded string', () => { + const object = { + metadata: { + name: 'test' + }, + status: { + startedAt: '2021-01-01T10:30:00Z' + } + }; + expect(ProcessURL('https://logging/$%7Bmetadata.name%7D', object)).toBe('https://logging/test'); + }); + test('epoch timestamp', () => { const object = { status: { diff --git a/ui/src/app/shared/components/links.tsx b/ui/src/app/shared/components/links.tsx index c6d1092ebd3f..0cbb09819d13 100644 --- a/ui/src/app/shared/components/links.tsx +++ b/ui/src/app/shared/components/links.tsx @@ -22,16 +22,20 @@ const addEpochTimestamp = (jsonObject: {metadata: ObjectMeta; workflow?: Workflo }; export const ProcessURL = (url: string, jsonObject: any) => { + /* decode url string to apply templating */ + const decodedUrl = decodeURI(url); addEpochTimestamp(jsonObject); /* replace ${} from input url with corresponding elements from object return null if element is not found*/ - return url.replace(/\${[^}]*}/g, x => { - const res = x - .replace(/[${}]+/g, '') - .split('.') - .reduce((p: any, c: string) => (p && p[c]) || null, jsonObject); - return res; - }); + return encodeURI( + decodedUrl.replace(/\${[^}]*}/g, x => { + const res = x + .replace(/[${}]+/g, '') + .split('.') + .reduce((p: any, c: string) => (p && p[c]) || null, jsonObject); + return res; + }) + ); }; export const Links = ({scope, object, button}: {scope: string; object: {metadata: ObjectMeta; workflow?: Workflow; status?: any}; button?: boolean}) => { @@ -47,7 +51,7 @@ export const Links = ({scope, object, button}: {scope: string; object: {metadata }, []); const formatUrl = (url: string) => { - return encodeURI(ProcessURL(decodeURI(url), object)); + return ProcessURL(url, object); }; const openLink = (url: string) => {