Skip to content

Add a step that stores diff info about a pull/merge request#5499

Merged
p12tic merged 3 commits intobuildbot:masterfrom
p12tic:steps-diffinfo
Mar 14, 2021
Merged

Add a step that stores diff info about a pull/merge request#5499
p12tic merged 3 commits intobuildbot:masterfrom
p12tic:steps-diffinfo

Conversation

@p12tic
Copy link
Copy Markdown
Member

@p12tic p12tic commented Aug 23, 2020

This step will be useful for reporters to know which warnings have been generated in changed code.

I think for now let's not merge the PR, it will become clear whether it works well enough or not once I'll have some reporters that could consume the data and will test everything end to end.

Contributor Checklist:

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

@p12tic p12tic changed the title WIP: Add a step that stores diff inof about a pull/merge request WIP: Add a step that stores diff info about a pull/merge request Aug 23, 2020
from buildbot.process import results


class DiffInfo(buildstep.ShellMixin, buildstep.BuildStep):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I guess this shall be GitDiffInfo...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed now.


The `DiffInfo` step gathers information about differences between the current revision and the last common ancestor of this revision and another commit or branch.
This information is useful for various reporters to be able to identify new warnings that appear in newly modified code.
The diff information is stored as a custom json as transient build data via ``setBuildData`` function.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we probably need a spec for this data, so that other VCS can generate the same data.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed now.

self.expectOutcome(result=results.SUCCESS, state_string="diffinfo")

diff_info = (
b'[{"source_file": "a/file1", "target_file": "/dev/null", ' +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would strip the 'a/' which is git specific.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added --no-prefix option to git to get rid of these.

@stale
Copy link
Copy Markdown

stale bot commented Dec 25, 2020

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stalled label Dec 25, 2020
@stale stale bot removed the stalled label Mar 12, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2021

Codecov Report

Merging #5499 (871a3e6) into master (44e8a74) will decrease coverage by 0.02%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5499      +/-   ##
==========================================
- Coverage   91.69%   91.67%   -0.03%     
==========================================
  Files         338      339       +1     
  Lines       36179    36230      +51     
==========================================
+ Hits        33175    33213      +38     
- Misses       3004     3017      +13     
Impacted Files Coverage Δ
master/buildbot/process/buildstep.py 94.05% <50.00%> (-0.16%) ⬇️
master/buildbot/steps/gitdiffinfo.py 95.91% <95.91%> (ø)
master/buildbot/scripts/cleanupdb.py 86.79% <0.00%> (-13.21%) ⬇️
master/buildbot/__init__.py 90.76% <0.00%> (-1.54%) ⬇️
worker/buildbot_worker/__init__.py 91.04% <0.00%> (-1.50%) ⬇️
master/buildbot/db/connector.py 98.83% <0.00%> (-1.17%) ⬇️

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 44e8a74...871a3e6. Read the comment docs.

@p12tic p12tic changed the title WIP: Add a step that stores diff info about a pull/merge request Add a step that stores diff info about a pull/merge request Mar 13, 2021
@p12tic p12tic merged commit 9d74f71 into buildbot:master Mar 14, 2021
@p12tic p12tic deleted the steps-diffinfo branch March 14, 2021 11:01
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Apr 10, 2021
Ref: buildbot/buildbot#5499



git-svn-id: file:///srv/repos/svn-community/svn@915582 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Apr 10, 2021
Ref: buildbot/buildbot#5499



git-svn-id: file:///srv/repos/svn-community/svn@915582 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Apr 12, 2021
See buildbot/buildbot#5499 for the new unidiff dependency


git-svn-id: file:///srv/repos/svn-community/svn@915851 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this pull request Apr 12, 2021
See buildbot/buildbot#5499 for the new unidiff dependency

git-svn-id: file:///srv/repos/svn-community/svn@915851 9fca08f4-af9d-4005-b8df-a31f2cc04f65
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.

2 participants