postrelease should fail if we didn't push to mirrors

RESOLVED FIXED

Status

Release Engineering
Release Automation
P2
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: massimo, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1953] )

Attachments

(1 attachment)

(Reporter)

Description

3 years ago
postrelease should fail if the push to mirror did not happen/succeeded.
 
see: https://bugzilla.mozilla.org/show_bug.cgi?id=1083127#c2
It would be good to catch this. Might just need a simple test on .../<stage-product>/releases/<version>/ existing prior to modifying the symlink.
(Reporter)

Comment 2

3 years ago
Created attachment 8510542 [details] [diff] [review]
[tools] Bug 1083208 - postrelease should fail if we didn't push to mirrors.patch

Hi Nick,

here's a fix (tested on dev-master) but I am not sure the push_to_mirrors_dir value is the right one for production.
Attachment #8510542 - Flags: review?(nthomas)
Comment on attachment 8510542 [details] [diff] [review]
[tools] Bug 1083208 - postrelease should fail if we didn't push to mirrors.patch

>diff --git a/scripts/release/stage-tasks.py b/scripts/release/stage-tasks.py
>index 53b4a72..2d5cb19 100755
>--- a/scripts/release/stage-tasks.py
>+++ b/scripts/release/stage-tasks.py
>@@ -193,6 +193,19 @@ def deleteIndexFiles(cleanup_dir, stageServer, stageUsername,
> 
> def updateSymlink(productName, version, stageServer, stageUsername,
>                   stageSshKey, target):
>+    # step 1 check if we have already push to mirrors (bug 1083208)

Nit, s/push/pushed/

>+    push_to_mirrors_dir = '/pub/mozilla.org/%s/releases/%s' % (productName, version)

You can use 
   release_dir = makeReleasesDir(productName, version)
for this.

>+    try:
>+        # check if the remote dir exists
>+        run_remote_cmd('test -d %s' % push_to_mirrors_dir,

We normally write this as ['test', '-d', release_dir]

>+                       server=stageServer, username=stageUsername,
>+                       sshKey=stageSshKey)
>+    except CalledProcessError:
>+            log.error('ERROR: push to mirrors directory, %s, does not exists on %s'
>+                      % (push_to_mirrors_dir, stageServer))

Nit, 'ERROR: release directory, %s, doesn't exist on %s'.

r+ with those fixed and retested.
Attachment #8510542 - Flags: review?(nthomas) → review+
(Reporter)

Comment 4

3 years ago
Comment on attachment 8510542 [details] [diff] [review]
[tools] Bug 1083208 - postrelease should fail if we didn't push to mirrors.patch

Thanks Nick.

Updated, tested in staging and landed.
Attachment #8510542 - Flags: checked-in+

Updated

3 years ago
Whiteboard: [kanban:engops:https://mozilla.kanbanize.com/ctrl_board/6/1953]
(Reporter)

Updated

3 years ago
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.