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

Fix descriptionSuffix for rpm Mock build steps #6316

Merged
merged 1 commit into from
Jan 17, 2022

Conversation

sjoegren
Copy link
Contributor

This fixes the build step summary so that it updates nicely, for example
"mock buildsrpm [dnf install]" when Mock step is running.
Fix MockStateObserver that looks for progress in "state.log", written by
mock. Since ~2012, mock changed from writing "State Changed:" in the
log. Example of current state.log:

2021-12-06 13:40:36,897 - Mock Version: 1.2.17
2021-12-06 13:40:37,074 - Start: yum install
2021-12-06 13:43:46,593 - Finish: yum install
2021-12-06 13:43:48,038 - Start: creating cache
2021-12-06 13:43:57,480 - Finish: creating cache
2021-12-06 13:43:57,482 - Finish: chroot init
2021-12-06 13:43:57,579 - Start: buildsrpm
2021-12-06 13:43:57,780 - Start: rpmbuild -bs
2021-12-06 13:43:57,972 - Finish: rpmbuild -bs
2021-12-06 13:43:57,977 - Finish: buildsrpm
2021-12-06 13:43:57,978 - Start: clean chroot
2021-12-06 13:44:03,010 - Finish: clean chroot
2021-12-06 13:44:03,011 - Finish: run

So now, look for "Start:" and "Finish:" lines and update the build steps
descriptionSuffix accordingly.

Contributor Checklist:

  • I have updated the unit tests
  • I have created a file in the newsfragments directory (and read the README.txt in that directory)
  • I have updated the appropriate documentation

@@ -25,16 +25,16 @@


class MockStateObserver(logobserver.LogLineObserver):
_line_re = re.compile(r'^.*State Changed: (.*)$')
Copy link
Member

Choose a reason for hiding this comment

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

I imagine this RE was correct at some point. Could you document which version of mock we now support?
I dont think this is worth to support both, but we should document it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I added it in the docstring. As it should still work, just not update the build step description on mock progress, perhaps it doesn't need documentation in the actual user docs?

@p12tic
Copy link
Member

p12tic commented Jan 3, 2022

LGTM, please prefix your commit description with steps/rpm: and we're good to go. Thanks!

This fixes the build step summary so that it updates nicely, for example
"mock buildsrpm [dnf install]" when Mock step is running.
Fix MockStateObserver that looks for progress in "state.log", written by
mock. Since ~2012, mock changed from writing "State Changed:" in the
log. Example of current state.log:

  2021-12-06 13:40:36,897 - Mock Version: 1.2.17
  2021-12-06 13:40:37,074 - Start: yum install
  2021-12-06 13:43:46,593 - Finish: yum install
  2021-12-06 13:43:48,038 - Start: creating cache
  2021-12-06 13:43:57,480 - Finish: creating cache
  2021-12-06 13:43:57,482 - Finish: chroot init
  2021-12-06 13:43:57,579 - Start: buildsrpm
  2021-12-06 13:43:57,780 - Start: rpmbuild -bs
  2021-12-06 13:43:57,972 - Finish: rpmbuild -bs
  2021-12-06 13:43:57,977 - Finish: buildsrpm
  2021-12-06 13:43:57,978 - Start: clean chroot
  2021-12-06 13:44:03,010 - Finish: clean chroot
  2021-12-06 13:44:03,011 - Finish: run

So now, look for "Start:" and "Finish:" lines and update the build steps
`descriptionSuffix` accordingly.
@sjoegren
Copy link
Contributor Author

sjoegren commented Jan 4, 2022

LGTM, please prefix your commit description with steps/rpm: and we're good to go. Thanks!

Done, and rebased on top of buildbot:master.

@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #6316 (1d0d175) into master (708b263) will increase coverage by 0.00%.
The diff coverage is 57.14%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6316   +/-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files         335      335           
  Lines       37581    37584    +3     
=======================================
+ Hits        34571    34574    +3     
  Misses       3010     3010           
Impacted Files Coverage Δ
master/buildbot/steps/package/rpm/mock.py 89.53% <57.14%> (+0.37%) ⬆️

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 708b263...1d0d175. Read the comment docs.

@p12tic p12tic merged commit 1044517 into buildbot:master Jan 17, 2022
@sjoegren sjoegren deleted the fix-mock-state-observer branch January 17, 2022 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants