From d01a933b7333983aa9a4f655ffac1643ea3b491c Mon Sep 17 00:00:00 2001 From: Bel LaPointe Date: Tue, 8 Feb 2022 09:39:20 -0700 Subject: [PATCH] baby frontend soundin good --- app/crawler/gitlab.sh | 13 ++++-- app/crawler/gitlab_test.sh | 3 ++ app/crawler/test.sh | 1 + spike/review/reinvent/ezmded/ui/index.html | 50 ++++++++++++++++++++++ 4 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 spike/review/reinvent/ezmded/ui/index.html diff --git a/app/crawler/gitlab.sh b/app/crawler/gitlab.sh index 63608f9..9d4acb3 100644 --- a/app/crawler/gitlab.sh +++ b/app/crawler/gitlab.sh @@ -37,11 +37,16 @@ gitlab() ( local url="$1" local url_path="${url#http*://gitlab*.net/}" local project="${url_path%%/-/*}" + local project="${project%%/tree/*}" local root="${url_path#*$project}" - local root="${root#*/-/}" - local root="${root#tree/}" - local root="${root#blob/}" - local root="${root#*/}" + local root="${root#*/-}" + if [ "$root" != "${root#/tree}" ]; then + root="${root#/tree}" + root="/${root#/*/}" + fi + local root="${root#/blob}" + local root="${root#/}" + log project=$project, root=$root, url=$url echo "$project" echo "$root" } diff --git a/app/crawler/gitlab_test.sh b/app/crawler/gitlab_test.sh index 53d1502..d087a54 100644 --- a/app/crawler/gitlab_test.sh +++ b/app/crawler/gitlab_test.sh @@ -47,6 +47,9 @@ EOF } test_url_to_project_root() { + gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | grep -q '^data-store/orchestration/runbooks$' + gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/tree/master | tail -n 1 | grep ^$ + gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'data-store/orchestration/runbooks' gitlab _url_to_project_root https://gitlab-app.eng.qops.net/data-store/orchestration/runbooks/-/blob/master/Alerts/rems/README.md | grep -q 'Alerts/rems/README.md' diff --git a/app/crawler/test.sh b/app/crawler/test.sh index 62e44dd..8aae3be 100644 --- a/app/crawler/test.sh +++ b/app/crawler/test.sh @@ -44,6 +44,7 @@ each() { source ./cache.sh set -e set -o pipefail + log() { echo "> $*" >&2; } } if [ "$0" == "$BASH_SOURCE" ]; then diff --git a/spike/review/reinvent/ezmded/ui/index.html b/spike/review/reinvent/ezmded/ui/index.html new file mode 100644 index 0000000..a0ecfa5 --- /dev/null +++ b/spike/review/reinvent/ezmded/ui/index.html @@ -0,0 +1,50 @@ + + +
+ + + + +
+ + + + +