Skip to content

Commit

Permalink
Cherry-pick 263099@main (feea593). rdar://107615755
Browse files Browse the repository at this point in the history
    [git-webkit] Provide mechanism to exempt bugs from redaction (Follow-up)
    https://bugs.webkit.org/show_bug.cgi?id=254993
    rdar://107615755

    Reviewed by Dewei Zhu.

    * Tools/Scripts/libraries/webkitscmpy/setup.py: Bump version.
    * Tools/Scripts/libraries/webkitscmpy/webkitscmpy/__init__.py: Ditto.
    * Tools/Scripts/libraries/webkitscmpy/webkitscmpy/program/pull_request.py:
    (PullRequest.create_pull_request): If the issue exempt from redaction is the second issue,
    we should print the fact that the first redacted issue is being made public.
    * Tools/Scripts/libraries/webkitscmpy/webkitscmpy/test/pull_request_unittest.py:

    Canonical link: https://commits.webkit.org/263099@main

Canonical link: https://commits.webkit.org/259548.673@safari-7615-branch
  • Loading branch information
JonWBedard authored and webkit-early-warning-system committed Apr 21, 2023
1 parent 696c971 commit 8c86863
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Tools/Scripts/libraries/webkitscmpy/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def readme():

setup(
name='webkitscmpy',
version='6.2.1',
version='6.2.2',
description='Library designed to interact with git and svn repositories.',
long_description=readme(),
classifiers=[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _maybe_add_webkitcorepy_path():
"Please install webkitcorepy with `pip install webkitcorepy --extra-index-url <package index URL>`"
)

version = Version(6, 2, 1)
version = Version(6, 2, 2)

AutoInstall.register(Package('fasteners', Version(0, 15, 0)))
AutoInstall.register(Package('jinja2', Version(2, 11, 3)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def create_pull_request(cls, repository, args, branch_point, callback=None, unbl
for candidate in issues:
if getattr(candidate.redacted, 'exemption', False):
redaction_exemption = candidate
if candidate.redacted:
elif candidate.redacted:
redacted_issue = candidate
if redaction_exemption:
print('A commit you are uploading references {}'.format(redaction_exemption.link))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1026,8 +1026,8 @@ def test_github_branch_redaction_exemption(self):
), patch(
'webkitbugspy.Tracker._trackers', [bugzilla.Tracker(
self.BUGZILLA,
redact={'component:Text': True},
redact_exemption={'component:Scrolling': True},
redact={'component:Scrolling': True},
redact_exemption={'component:Text': True},
)]
), mocks.local.Git(
self.path, remote='https://{}'.format(remote.remote),
Expand Down Expand Up @@ -1063,16 +1063,16 @@ def test_github_branch_redaction_exemption(self):
self.maxDiff = None
self.assertEqual(
captured.stdout.getvalue(),
"A commit you are uploading references https://bugs.example.com/show_bug.cgi?id=2\n"
"https://bugs.example.com/show_bug.cgi?id=2 matches 'component:Scrolling' and is exempt from redaction\n"
"A commit you are uploading references https://bugs.example.com/show_bug.cgi?id=1\n"
"https://bugs.example.com/show_bug.cgi?id=1 matches 'component:Text' and is exempt from redaction\n"
"Created 'PR 1 | [Testing] Existing commit'!\n"
"Posted pull request link to https://bugs.example.com/show_bug.cgi?id=2\n"
"https://github.example.com/WebKit/WebKit/pull/1\n",
)
self.assertEqual(
captured.stderr.getvalue(),
'Redaction exemption overrides the redaction of https://bugs.example.com/show_bug.cgi?id=1\n'
"https://bugs.example.com/show_bug.cgi?id=1 matches 'component:Text' and is thus redacted\n",
'Redaction exemption overrides the redaction of https://bugs.example.com/show_bug.cgi?id=2\n'
"https://bugs.example.com/show_bug.cgi?id=2 matches 'component:Scrolling' and is thus redacted\n",
)
log = captured.root.log.getvalue().splitlines()
self.assertEqual(
Expand Down

0 comments on commit 8c86863

Please sign in to comment.