Merge ~alextu/pc-enablement/+git/oem-scripts:auto-bug-assignee into ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master

Proposed by Alex Tu
Status: Merged
Merged at revision: b4e1999ca35bf4bd0a070ba538d18132f9261fe5
Proposed branch: ~alextu/pc-enablement/+git/oem-scripts:auto-bug-assignee
Merge into: ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master
Diff against target: 58 lines (+23/-3)
1 file modified
trigger-sanity3.sh (+23/-3)
Reviewer Review Type Date Requested Status
Shih-Yuan Lee Approve
Yao Wei Pending
StanleyHuang Pending
jeremyszu Pending
Dirk Su Pending
Review via email: mp+413656@code.launchpad.net
To post a comment you must log in.
Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
blame: .
badpkg: rules build failed with exit code 2
erroneous package: rules build failed with exit code 2

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-21372bf-in-linux-container-focal

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

In trigger-sanity3.sh line 96:
                if [ -n "auto_create_bug_assignee" ]; then
                         ^----------------------^ SC2157: Argument to -n is always true due to literal strings.
Please fix it.

Revision history for this message
Alex Tu (alextu) wrote :

sorry for that missing, it has been fixed and please review it again.

Revision history for this message
Alex Tu (alextu) wrote :

a8e0089 is to auto-retry instead of just existing when HIC is temporarily unavailable.

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-acdefcb-in-linux-container-focal

Revision history for this message
Alex Tu (alextu) wrote :

And please review another MP after done this MP if you are available.
https://code.launchpad.net/~alextu/pc-enablement/+git/oem-scripts/+merge/413710

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
blame: .
badpkg: rules build failed with exit code 2
erroneous package: rules build failed with exit code 2

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-a8e0089-in-linux-container-focal

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

In trigger-sanity3.sh line 80:
    for i in $(seq 1 5); do
    ^-^ SC2034: i appears unused. Verify use (or export if used externally).

In trigger-sanity3.sh line 82:
        [ -n "$ONLINE_IPS" ] || (seep 5; continue)
                                         ^------^ SC2106: This only exits the subshell caused by the (..) group.

For more information:
  https://www.shellcheck.net/wiki/SC2034 -- i appears unused. Verify use (or ...
  https://www.shellcheck.net/wiki/SC2106 -- This only exits the subshell caus...

Please fix them.

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
blame: .
badpkg: rules build failed with exit code 2
erroneous package: rules build failed with exit code 2

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-7053c1c-in-linux-container-focal

Revision history for this message
OEM Taipei Bot (oem-taipei-bot) wrote :

[autopkgtest]
autopkgtest-collect-credentials PASS
autopkgtest-oem-scripts-auto PASS
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bootstrap-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
oem-meta-packages PASS
pkg-list PASS
review-merge-proposal PASS
run-autopkgtest PASS
setup-apt-dir PASS
mir-bug SKIP exit status 77 and marked as skippable
git-url-insteadof-setting PASS
lp-dl-attm PASS
recovery-from-iso.sh PASS

https://oem-share.canonical.com/partners/lyoncore/share/artifacts/oem-scripts/oem-scripts-1.29-1f9d0d0-in-linux-container-focal

Revision history for this message
Shih-Yuan Lee (fourdollars) wrote :

LGTM

review: Approve
Revision history for this message
Dirk Su (dirksu) wrote :

http://"$HIC_ADDR"/q?db=ipo reading fail will get {}, can't satisfied the retry condition

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/trigger-sanity3.sh b/trigger-sanity3.sh
2index c7b5008..6098b80 100755
3--- a/trigger-sanity3.sh
4+++ b/trigger-sanity3.sh
5@@ -48,7 +48,10 @@ Options:
6 --command_before_run_plan sanity-3 parameter cmd_before_run_plan
7 --inj_recovery sanity-3 parameter inj_recovery, default is false
8 --gitbranch_oem_sanity sanity-3 parameter gitbranch_oem_sanity, default is master
9- --auto_create_bugs sanity-3 parameter auto_create_bugs, default is false
10+ --auto_create_bugs (obsoleted)sanity-3 parameter auto_create_bugs, default is false
11+ --auto_create_bug_assignee sanity-3 parameter AUTO_CREATE_BUGS_ASSIGNEE, put the target launchpad id here.
12+ The bugs will not be automatically created if this parameter is empty. default is empty.
13+ (e.g. stanley31)
14 EOF
15 exit 1
16 }
17@@ -74,7 +77,16 @@ trigger_sanity_3() {
18 #get mapping of tag to skus
19 skus=$(curl ${silent} http://"$HIC_ADDR"/q?db=tag | jq -r --arg TAG "$tag" 'with_entries(select(.value | startswith($TAG))) | keys | @sh' | tr -d \')
20
21- ONLINE_IPS=$(curl ${silent} http://"$HIC_ADDR"/q?db=ipo)
22+ for i in $(seq 1 10); do
23+ ONLINE_IPS=$(curl ${silent} http://"$HIC_ADDR"/q?db=ipo)
24+ if [ -z "$ONLINE_IPS" ]; then
25+ echo "retry $i: get online IPs from hic server."
26+ sleep 5
27+ continue
28+ fi
29+ break
30+ done
31+ [ -n "$ONLINE_IPS" ] || (echo "hic server(http://$HIC_ADDR/q?db=ipo) no response"; exit 1)
32 for sku in $skus
33 do
34 #check sku has valid cid
35@@ -89,7 +101,11 @@ trigger_sanity_3() {
36 if [ -n "$status" ];then
37 echo "trigger job sanity-3-testflinger-$project-$cid-staging"
38 if [ $dry_run -eq 0 ];then
39- curl -X POST http://"$user":"$token"@"$JENKINS_ADDR"/job/sanity-3-testflinger-"$project"-"$cid"-staging/buildWithParameters\?EXCLUDE_TASK="$exclude_task"\&TARGET_IMG="$target_img"\&IMAGE_NO="$image_no"\&PLAN="$plan"\&CMD_BEFOR_RUN_PLAN="$cmd_before_run_plan"\&INJ_RECOVERY="$inj_recovery"\&GITBRANCH_OEM_SANITY="$gitbranch_oem_sanity"\&AUTO_CREATE_BUGS="$auto_create_bugs"
40+ if [ -n "$auto_create_bug_assignee" ]; then
41+ curl -X POST http://"$user":"$token"@"$JENKINS_ADDR"/job/sanity-3-testflinger-"$project"-"$cid"-staging/buildWithParameters\?EXCLUDE_TASK="$exclude_task"\&TARGET_IMG="$target_img"\&IMAGE_NO="$image_no"\&PLAN="$plan"\&CMD_BEFOR_RUN_PLAN="$cmd_before_run_plan"\&INJ_RECOVERY="$inj_recovery"\&GITBRANCH_OEM_SANITY="$gitbranch_oem_sanity"\&AUTO_CREATE_BUGS_ASSIGNEE="$auto_create_bug_assignee"
42+ else
43+ curl -X POST http://"$user":"$token"@"$JENKINS_ADDR"/job/sanity-3-testflinger-"$project"-"$cid"-staging/buildWithParameters\?EXCLUDE_TASK="$exclude_task"\&TARGET_IMG="$target_img"\&IMAGE_NO="$image_no"\&PLAN="$plan"\&CMD_BEFOR_RUN_PLAN="$cmd_before_run_plan"\&INJ_RECOVERY="$inj_recovery"\&GITBRANCH_OEM_SANITY="$gitbranch_oem_sanity"\&AUTO_CREATE_BUGS="$auto_create_bugs"
44+ fi
45 fi
46 else
47 echo "$sku is offline"
48@@ -156,6 +172,10 @@ main() {
49 shift
50 auto_create_bugs=$1
51 ;;
52+ --auto_create_bug_assignee)
53+ shift
54+ auto_create_bug_assignee="$1"
55+ ;;
56 *)
57 echo "Not recognize $1"
58 usage

Subscribers

People subscribed via source and target branches