Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't abort if weakremover.inc don't exist on source project #3049

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions gocd/microos.target.gocd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,69 @@ pipelines:
sleep 600
done
osc -A https://api.suse.de/ api "/build/SUSE:ALP:Products:Marble:6.0:PUBLISH/_result?view=summary&repository=product" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
SLCS.Images:
group: MicroOS
lock_behavior: unlockWhenFinished
materials:
repos:
git: git://botmaster.suse.de/suse-repos.git
auto_update: true
whitelist:
- SUSE:SLFO:Products:SLCS:6.0_-_images.yaml
destination: repos
scripts:
auto_update: true
git: https://github.com/openSUSE/openSUSE-release-tools.git
whitelist:
- DO_NOT_TRIGGER
destination: scripts
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-staging-bot
stages:
- Expect.Images.To.Finish:
resources:
- staging-bot
tasks:
- script: |
export PYTHONPATH=scripts
./scripts/gocd/verify-repo-built-successful.py -A https://api.suse.de -p SUSE:SLFO:Products:SLCS:6.0 -r images

- Release.Images.To.Test:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
set -e
for product in 000productcompose SLCS; do
osc -A https://api.suse.de release SUSE:SLFO:Products:SLCS:6.0 $product
done
sleep 600
while (osc -A https://api.suse.de/ api "/build/SUSE:SLFO:Products:SLCS:6.0:ToTest/_result?view=summary&repository=product" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/SUSE:SLFO:Products:SLCS:6.0:ToTest/_result?view=summary&repository=product" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED

- Release.Images.To.Publish:
approval: manual
roles:
- SLE
environment_variables:
OSC_CONFIG: /home/go/config/oscrc-totest-manager
resources:
- staging-bot
tasks:
- script: |-
set -e
osc -A https://api.suse.de release SUSE:SLFO:Products:SLCS:6.0:ToTest
sleep 600
while (osc -A https://api.suse.de/ api "/build/SUSE:SLFO:Products:SLCS:6.0:PUBLISH/_result?view=summary&repository=product" | grep "result project" | grep -v 'code="published" state="published">'); do
echo PENDING
sleep 600
done
osc -A https://api.suse.de/ api "/build/SUSE:SLFO:Products:SLCS:6.0:PUBLISH/_result?view=summary&repository=product" | grep "result project" | grep 'code="published" state="published">' && echo PUBLISHED
15 changes: 12 additions & 3 deletions osclib/freeze_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,20 @@
targeturl = self.api.makeurl(['source', self.prj, '000release-packages', 'weakremovers.inc'],
{'comment': 'Update weakremovers.inc'})
oldinc = osc.core.http_GET(targeturl).read()
targeturl_exists = True

Check warning on line 246 in osclib/freeze_command.py

View check run for this annotation

Codecov / codecov/patch

osclib/freeze_command.py#L246

Added line #L246 was not covered by tests
except HTTPError:
# if it doesn't exist, don't update
targeturl_exists = False
try:
sourceurl = self.api.makeurl(['source', self.api.project, '000release-packages', 'weakremovers.inc'])
inc = osc.core.http_GET(sourceurl).read()
sourceurl_exists = True

Check warning on line 252 in osclib/freeze_command.py

View check run for this annotation

Codecov / codecov/patch

osclib/freeze_command.py#L252

Added line #L252 was not covered by tests
except HTTPError:
sourceurl_exists = False
if targeturl_exists != sourceurl_exists:
raise Exception("weakremover.inc doesn't exist in both Staging and Parent project, please fix")

Check warning on line 256 in osclib/freeze_command.py

View check run for this annotation

Codecov / codecov/patch

osclib/freeze_command.py#L256

Added line #L256 was not covered by tests
if not (targeturl_exists) and not (sourceurl_exists):
# nothing to do
return
sourceurl = self.api.makeurl(['source', self.api.project, '000release-packages', 'weakremovers.inc'])
inc = osc.core.http_GET(sourceurl).read()
if inc != oldinc:
osc.core.http_PUT(targeturl, data=inc)

Expand Down
Loading