Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Fix a bug where upstream git commit was incorrectly pinned for stream… #495

Merged
merged 1 commit into from
Aug 9, 2021

Conversation

vfreex
Copy link
Contributor

@vfreex vfreex commented Aug 9, 2021

… assembly

Commit 0917797 introduced a new
behavior to prevent from rebuilding images/rpms off their latest commits
for non-stream assemblies.

However, assembly related fields in class Runtime are initialized too late,
which results in stream assembly builds are also pinned to their latest
upstream commits.

This PR moves up the code for initializing assembly related fields and
explicitly checks assembly_basis_event to decide whether pinning a commit is needed or not.

@vfreex vfreex requested review from joepvd, Ximinhan and jupierce August 9, 2021 08:32
@openshift-ci openshift-ci bot requested a review from sosiouxme August 9, 2021 08:32
@vfreex vfreex force-pushed the fix-rebase-stream-assembly branch from c45deec to cb12b0d Compare August 9, 2021 08:32
… assembly

Commit 0917797 introduced a new
behavior to prevent from rebuilding images/rpms off their latest commits
for non-stream assemblies.

However, assembly related fields in `class Runtime` are initialized too late,
which results in stream assembly builds are also pinned to their latest
upstream commits.

This PR moves up the code for initializing assembly related fields and
explicitly checks `assembly_basis_event` to decide whether pinning a commit is needed or not.
@vfreex vfreex force-pushed the fix-rebase-stream-assembly branch from cb12b0d to 3d35639 Compare August 9, 2021 08:37
Copy link
Contributor

@joepvd joepvd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@openshift-bot
Copy link

Build #1

GLOB sdist-make: /mnt/workspace/jenkins/working/art-tools_doozer_PR-495/setup.py
py3 create: /mnt/workspace/jenkins/working/art-tools_doozer_PR-495/.tox/py3
py3 installdeps: -rrequirements-dev.txt
py3 inst: /mnt/workspace/jenkins/working/art-tools_doozer_PR-495/.tox/.tmp/package/1/rh-doozer-1.3.15.zip
py3 installed: aiofiles==0.7.0,astroid==2.6.6,attrs==21.2.0,autopep8==1.5.7,backports.entry-points-selectable==1.1.0,bashlex==0.15,cached-property==1.5.2,certifi==2021.5.30,cffi==1.14.6,charset-normalizer==2.0.4,click==8.0.1,contextvars==2.4,coverage==5.5,cryptography==3.4.7,decorator==5.0.9,Deprecated==1.2.12,distlib==0.3.2,dockerfile-parse==1.2.0,filelock==3.0.12,flake8==3.9.2,flexmock==0.10.5,future==0.18.2,gssapi==1.6.14,idna==3.2,immutables==0.16,importlib-metadata==4.6.3,importlib-resources==5.2.2,iniconfig==1.1.1,isort==5.9.3,kobo==0.19.0,koji==1.25.1,lazy-object-proxy==1.6.0,mccabe==0.6.1,mock==4.0.3,mysql-connector-python==8.0.26,packaging==21.0,platformdirs==2.2.0,pluggy==0.13.1,protobuf==3.17.3,py==1.10.0,pycodestyle==2.7.0,pycparser==2.20,pyflakes==2.3.1,pygit2==1.6.1,PyGithub==1.55,PyJWT==2.1.0,pykerberos==1.2.1,pylint==2.9.6,PyNaCl==1.4.0,pyparsing==2.4.7,pytest==6.2.4,python-dateutil==2.8.2,PyYAML==5.4.1,requests==2.26.0,requests-gssapi==1.2.3,requests-kerberos==0.12.0,rh-doozer @ file:///mnt/workspace/jenkins/working/art-tools_doozer_PR-495/.tox/.tmp/package/1/rh-doozer-1.3.15.zip,rpm==4.14.3,rpm-py-installer==1.1.0,semver==2.13.0,six==1.16.0,tenacity==8.0.1,toml==0.10.2,tox==3.24.1,typed-ast==1.4.3,typing==3.7.4.3,typing-extensions==3.10.0.0,urllib3==1.26.6,virtualenv==20.7.0,wrapt==1.12.1,zipp==3.5.0
py3 run-test-pre: PYTHONHASHSEED='2929253897'
py3 run-test: commands[0] | flake8
py3 run-test: commands[1] | coverage run --branch --source doozerlib -m unittest discover -t . -s tests/
........................................................................s.s....................................s.s...s.s.s..s.s.s...................................................................................................................
----------------------------------------------------------------------
Ran 234 tests in 10.148s

OK (skipped=10)
py3 run-test: commands[2] | coverage report
Name                                    Stmts   Miss Branch BrPart  Cover
-------------------------------------------------------------------------
doozerlib/__init__.py                      11      4      2      1    62%
doozerlib/assembly.py                     153     50     87      8    63%
doozerlib/assembly_inspector.py           162    144     92      0     7%
doozerlib/assertion.py                     22      0      6      0   100%
doozerlib/brew.py                         340    195    148      3    39%
doozerlib/build_status_detector.py         85     10     54      3    86%
doozerlib/cli/__init__.py                 101     45     20      0    46%
doozerlib/cli/__main__.py                1155   1155    480      0     0%
doozerlib/cli/cli_opts.py                  16      3      6      0    86%
doozerlib/cli/config_plashet.py           533    533    248      0     0%
doozerlib/cli/detect_embargo.py           163     35     70      8    75%
doozerlib/cli/images_health.py             79     28     24      2    61%
doozerlib/cli/images_streams.py           556    556    232      0     0%
doozerlib/cli/release_gen_assembly.py     166    166     82      0     0%
doozerlib/cli/release_gen_payload.py      327    270    168      0    12%
doozerlib/cli/rpms_build.py               165     59     58      8    57%
doozerlib/cli/scan_sources.py             153    123     78      2    16%
doozerlib/config.py                        98     98     44      0     0%
doozerlib/constants.py                      9      0      0      0   100%
doozerlib/coverity.py                     238    209     74      0     9%
doozerlib/dblib.py                        248    152     68      4    35%
doozerlib/distgit.py                     1377    912    640     15    31%
doozerlib/dotconfig.py                     56     44     32      0    14%
doozerlib/exceptions.py                     3      0      0      0   100%
doozerlib/exectools.py                    194     75     76     17    56%
doozerlib/gitdata.py                      168    133     76      0    14%
doozerlib/image.py                        486    319    212      6    28%
doozerlib/logutil.py                       10      0      2      1    92%
doozerlib/metadata.py                     443    172    202     30    56%
doozerlib/model.py                        111     21     36      2    82%
doozerlib/olm/__init__.py                   0      0      0      0   100%
doozerlib/olm/bundle.py                   218    163     36      0    22%
doozerlib/operator_metadata.py            364     65     66      6    79%
doozerlib/plashet.py                      134      9     90     15    89%
doozerlib/pushd.py                         21      2      2      0    91%
doozerlib/repos.py                        207    105    113     17    44%
doozerlib/rhcos.py                        111     30     32      4    66%
doozerlib/rpm_builder.py                  226     31    121     32    81%
doozerlib/rpmcfg.py                       141     56     58      8    56%
doozerlib/runtime.py                      889    646    362      8    22%
doozerlib/source_modifications.py          89     28     18      3    65%
doozerlib/state.py                         24     12      8      0    38%
doozerlib/util.py                         325    136    114      5    55%
-------------------------------------------------------------------------
TOTAL                                   10377   6794   4337    208    31%
___________________________________ summary ____________________________________
  py3: commands succeeded
  congratulations :)

@codecov-commenter
Copy link

Codecov Report

Merging #495 (cb12b0d) into master (84c70eb) will increase coverage by 32.52%.
The diff coverage is 0.00%.

❗ Current head cb12b0d differs from pull request most recent head 3d35639. Consider uploading reports for the commit 3d35639 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           master     #495       +/-   ##
===========================================
+ Coverage        0   32.52%   +32.52%     
===========================================
  Files           0       42       +42     
  Lines           0    10377    +10377     
  Branches        0     2166     +2166     
===========================================
+ Hits            0     3375     +3375     
- Misses          0     6794     +6794     
- Partials        0      208      +208     
Impacted Files Coverage Δ
doozerlib/runtime.py 26.43% <0.00%> (ø)
doozerlib/image.py 33.12% <0.00%> (ø)
doozerlib/dblib.py 37.09% <0.00%> (ø)
doozerlib/__init__.py 54.54% <0.00%> (ø)
doozerlib/cli/__main__.py 0.00% <0.00%> (ø)
doozerlib/olm/bundle.py 25.22% <0.00%> (ø)
doozerlib/dotconfig.py 21.42% <0.00%> (ø)
doozerlib/cli/detect_embargo.py 73.61% <0.00%> (ø)
doozerlib/exectools.py 52.57% <0.00%> (ø)
doozerlib/config.py 0.00% <0.00%> (ø)
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84c70eb...3d35639. Read the comment docs.

@vfreex vfreex merged commit dbe3d91 into openshift-eng:master Aug 9, 2021
vfreex added a commit to vfreex/doozer that referenced this pull request Aug 9, 2021
dbe3d91 Fix a bug where upstream git commit was incorrectly pinned for stream assembly (openshift-eng#495)
084baa1 Turn git commit into a parsable yaml document This will allow our automation to be able to detect source and commit information without having to parse RPM spec files.
0917797 Build basis locked assemblies artifacts from their lastet build's upstream commit
c61bd43 Make evaluation of -alt image deterministic
e398878 Use unaltered git url to assess whether images are siblings
7d21721 Fixes for building from a specific commit
16f1e44 Allow assemblies to override streams
2a69d50 Do not write duplicate destinations
6821b79 Add emergency override
b908fe5 Gen-assembly from GA releases and default stream permits
788ae1e Reintroduce hotfix tagging
f4c42b7 Formalizing assembly issues and permitting them
20fdd0c Mitigate GSSAPIAuthError (openshift-eng#487)
5b7d850 Gen-payload for assembly fixes and updates for PR comments
cea8804 Make gen-payload enforce assembly consistency
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants