When a new branch exists on gerrit, but has never been seen by RTD
we need to trigger a job so that the branch is discovered
we can then mark it active in the following step.
API changed under out feet, where a 404 was returned before
we now get a 200 with the string null.
Change code to explicitly match the returned string of
"null"
Issue-Id: RELENG-3027
Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: I769b66384f5b53d87527faeb0f467350a847b65c
--- /dev/null
+---
+fixes:
+ - |
+ Fixed logic for discovering new branches
+ When a new branch exists on gerrit, but has never been seen by RTD
+ we need to trigger a job so that the branch is discovered
+ we can then mark it active in the following step.
+ API changed under out feet, where a 404 was returned before
+ we now get a 200 with the string null.
+ Change code to explicitly match the returned string of
+ "null"
branch=$(echo "$GERRIT_BRANCH" | tr '[:upper:]' '[:lower:]')
echo "INFO: Checking if read the docs has seen branch $branch"
- #if this is 404. then run discover branch
- if ! lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active'; then
+ #if this is 200 "null" Then run discover branch
+ if [[ $(lftools rtd project-version-details "$rtdproject" "$branch" | jq '.active') == "null" ]]; then
echo "INFO: read the docs has not seen branch $branch for project $rtdproject"
echo "INFO: triggering $rtdproject latest to instantiate new branch discovery"
watchbuild latest