WebKit Bugzilla
Attachment 341662 Details for
Bug 186135
: export-w3c-test-changes should use the new location & name of the WPT repo
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186135-20180531152308.patch (text/plain), 10.15 KB, created by
Frédéric Wang (:fredw)
on 2018-05-31 06:23:09 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-05-31 06:23:09 PDT
Size:
10.15 KB
patch
obsolete
>Subversion Revision: 232288 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 10e9cfbe52c401c9e4b26c80817d4be75b7dac61..93eeff5b88cf94a3cf9445adc0a8e4627033f7cf 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,29 @@ >+2018-05-31 Frederic Wang <fwang@igalia.com> >+ >+ export-w3c-test-changes should use the new location & name of the WPT repo >+ https://bugs.webkit.org/show_bug.cgi?id=186135 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Web platform tests have been moved to GitHub's web-platform-tests/wpt. This patch updates the >+ corresponding variables to use the new organization and repository name. It also refactors a >+ bit the code to reduce the amount of hardcoded strings. >+ >+ * Scripts/webkitpy/w3c/common.py: Use org web-platform-tests, repo name wpt. Also removes the >+ final slash to WPT_GH_URL, so it can be used for repo URL too. >+ * Scripts/webkitpy/w3c/test_exporter.py: Import more symbols and define WPT_PR_URL from >+ WPT_GH_URL. >+ (WebPlatformTestExporter._wpt_fork_branch_github_url): Use WPT_GH_REPO_NAME. >+ (WebPlatformTestExporter._wpt_fork_push_url): Use WPT_GH_REPO_NAME. >+ (WebPlatformTestExporter._git): Use WPT_GH_URL. >+ (WebPlatformTestExporter._ensure_username_and_token): Use WPT_GH_ORG, WPT_GH_REPO_NAME. >+ (WebPlatformTestExporter.make_pull_request): Use WPT_GH_ORG, WPT_GH_REPO_NAME. >+ (parse_args): Use WPT_GH_REPO_NAME, WPT_GH_URL. >+ * Scripts/webkitpy/w3c/test_exporter_unittest.py: >+ (TestExporterTest.test_export): Update organization and repository names for the remote >+ branch and pull request. >+ (TestExporterTest.test_export_with_specific_branch): Update repository name. >+ > 2018-05-29 Youenn Fablet <youenn@apple.com> > > Add a consistency check between URL and CFURL >diff --git a/Tools/Scripts/webkitpy/w3c/common.py b/Tools/Scripts/webkitpy/w3c/common.py >index 66fa34f2a7e9af17376b643cb4c1a64a9888b20f..29ce3bef87f84570c6af8595d4ff80f3333eb5f6 100644 >--- a/Tools/Scripts/webkitpy/w3c/common.py >+++ b/Tools/Scripts/webkitpy/w3c/common.py >@@ -33,9 +33,9 @@ import logging > import os > > >-WPT_GH_ORG = os.environ.get('WPT_GH_ORG', 'w3c') >-WPT_GH_REPO_NAME = os.environ.get('WPT_GH_REPO_NAME', 'web-platform-tests') >-WPT_GH_URL = 'https://github.com/%s/%s/' % (WPT_GH_ORG, WPT_GH_REPO_NAME) >+WPT_GH_ORG = os.environ.get('WPT_GH_ORG', 'web-platform-tests') >+WPT_GH_REPO_NAME = os.environ.get('WPT_GH_REPO_NAME', 'wpt') >+WPT_GH_URL = 'https://github.com/%s/%s' % (WPT_GH_ORG, WPT_GH_REPO_NAME) > WPT_MIRROR_URL = 'https://chromium.googlesource.com/external/w3c/web-platform-tests.git' > WPT_GH_SSH_URL_TEMPLATE = 'https://{}@github.com/%s/%s.git' % (WPT_GH_ORG, WPT_GH_REPO_NAME) > WPT_REVISION_FOOTER = 'WPT-Export-Revision:' >diff --git a/Tools/Scripts/webkitpy/w3c/test_exporter.py b/Tools/Scripts/webkitpy/w3c/test_exporter.py >index f762de4647c472fbe60cfe7474cf68569ffb71c4..f4b8797ed4b5cf68a8887cd7349be1d20d16b044 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_exporter.py >+++ b/Tools/Scripts/webkitpy/w3c/test_exporter.py >@@ -37,13 +37,13 @@ from webkitpy.common.net.bugzilla import Bugzilla > from webkitpy.common.webkit_finder import WebKitFinder > from webkitpy.w3c.wpt_github import WPTGitHub > from webkitpy.w3c.wpt_linter import WPTLinter >-from webkitpy.w3c.common import WPT_GH_ORG >+from webkitpy.w3c.common import WPT_GH_ORG, WPT_GH_REPO_NAME, WPT_GH_URL > from webkitpy.common.memoized import memoized > > _log = logging.getLogger(__name__) > > WEBKIT_WPT_DIR = 'LayoutTests/imported/w3c/web-platform-tests' >-WPT_PR_URL = "https://github.com/%s/web-platform-tests/pull/" % WPT_GH_ORG >+WPT_PR_URL = "%s/pull/" % WPT_GH_URL > WEBKIT_EXPORT_PR_LABEL = 'webkit-export' > > EXCLUDED_FILE_SUFFIXES = ['-expected.txt', '.worker.html', '.any.html', '.any.worker.html'] >@@ -102,7 +102,7 @@ class WebPlatformTestExporter(object): > @property > @memoized > def _wpt_fork_branch_github_url(self): >- return "https://github.com/" + self.username + "/web-platform-tests/tree/" + self._public_branch_name >+ return "https://github.com/%s/%s/tree/%s" % (self.username, WPT_GH_REPO_NAME, self._public_branch_name) > > @property > @memoized >@@ -118,14 +118,14 @@ class WebPlatformTestExporter(object): > def _wpt_fork_push_url(self): > wpt_fork_push_url = self._options.repository_remote_url > if not wpt_fork_push_url: >- wpt_fork_push_url = "https://" + self.username + "@github.com/" + self.username + "/web-platform-tests.git" >+ wpt_fork_push_url = "https://%s@github.com/%s/%s.git" % (self.username, self.username, WPT_GH_REPO_NAME) > > return wpt_fork_push_url > > @property > @memoized > def _git(self): >- return self._ensure_wpt_repository("https://github.com/w3c/web-platform-tests.git", self._options.repository_directory, self._gitClass) >+ return self._ensure_wpt_repository("%s.git" % WPT_GH_URL, self._options.repository_directory, self._gitClass) > > @property > @memoized >@@ -215,7 +215,7 @@ class WebPlatformTestExporter(object): > if not self._token: > self._token = self._prompt_for_token(options) > if not self._token: >- _log.info("Missing GitHub token, the script will not be able to create a pull request to W3C web-platform-tests repository.") >+ _log.info("Missing GitHub token, the script will not be able to create a pull request to %s's %s repository." % (WPT_GH_ORG, WPT_GH_REPO_NAME)) > > if self._token: > self._validate_and_save_token(self._username, self._token) >@@ -322,7 +322,7 @@ class WebPlatformTestExporter(object): > self._github.add_label(pr_number, WEBKIT_EXPORT_PR_LABEL) > except Exception as e: > _log.warning(e) >- _log.info('Could not add label "%s" to pr #%s. User "%s" may not have permission to update labels in the w3c/web-platform-test repo.' % (WEBKIT_EXPORT_PR_LABEL, pr_number, self.username)) >+ _log.info('Could not add label "%s" to pr #%s. User "%s" may not have permission to update labels in the %s/%s repo.' % (WEBKIT_EXPORT_PR_LABEL, pr_number, self.username, WPT_GH_ORG, WPT_GH_REPO_NAME)) > if self._bug_id and pr_number: > self._bugzilla.post_comment_to_bug(self._bug_id, "Submitted web-platform-tests pull request: " + WPT_PR_URL + str(pr_number)) > >@@ -387,10 +387,10 @@ def parse_args(args): > 'Tools/Scripts/export-w3c-test-changes -c -g HEAD -b XYZ' will do the following: > - Clone web-platform-tests repository if not done already and set it up for pushing branches. > - Gather WebKit bug id XYZ bug and changes to apply to web-platform-tests repository based on the HEAD commit >- - Create a remote branch named webkit-XYZ on https://github.com/USERNAME/web-platform-tests.git repository based on the locally applied patch. >+ - Create a remote branch named webkit-XYZ on https://github.com/USERNAME/%s.git repository based on the locally applied patch. > - USERNAME may be set using the environment variable GITHUB_USERNAME or as a command line option. It is then stored in git config as github.username. > - Github credential may be set using the environment variable GITHUB_TOKEN or as a command line option. (Please provide a valid GitHub 'Personal access token' with 'repo' as scope). It is then stored in git config as github.token. >- - Make the related pull request on https://github.com/w3c/web-platform-tests.git repository. >+ - Make the related pull request on %s.git repository. > - Clean the local Git repository > Notes: > - It is safer to provide a bug id using -b option (bug id from a git commit is not always working). >@@ -399,7 +399,7 @@ def parse_args(args): > FIXME: > - The script is not yet able to update an existing pull request > - Need a way to monitor the progress of the pul request so that status of all pending pull requests can be done at import time. >- """ >+ """ % (WPT_GH_REPO_NAME, WPT_GH_URL) > parser = argparse.ArgumentParser(prog='export-w3c-test-changes ...', description=description, formatter_class=argparse.RawDescriptionHelpFormatter) > > parser.add_argument('-g', '--git-commit', dest='git_commit', default=None, help='Git commit to apply') >diff --git a/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py b/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py >index a6ad8fca158aba8f00e59910e9661ab5adb7bf38..d77c555a25b43853778c3637684e40c115504d2b 100644 >--- a/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py >+++ b/Tools/Scripts/webkitpy/w3c/test_exporter_unittest.py >@@ -139,7 +139,7 @@ class TestExporterTest(unittest.TestCase): > 'apply_mail_patch patch.temp ', > 'commit -a -m WebKit export of https://bugs.webkit.org/show_bug.cgi?id=1234', > 'remote ', >- 'remote add USER https://USER@github.com/USER/web-platform-tests.git', >+ 'remote add USER https://USER@github.com/USER/wpt.git', > 'remote get-url USER', > 'push USER wpt-export-for-webkit-1234:wpt-export-for-webkit-1234 -f', > 'checkout master', >@@ -148,7 +148,7 @@ class TestExporterTest(unittest.TestCase): > 'reset hard origin/master']) > self.assertEquals(exporter._bugzilla.calls, [ > 'fetch bug 1234', >- 'post comment to bug 1234 : Submitted web-platform-tests pull request: https://github.com/w3c/web-platform-tests/pull/5678']) >+ 'post comment to bug 1234 : Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/5678']) > self.assertEquals(mock_linter.calls, ['/mock-checkout/WebKitBuild/w3c-tests/web-platform-tests', 'lint']) > > def test_export_with_specific_branch(self): >@@ -166,7 +166,7 @@ class TestExporterTest(unittest.TestCase): > 'apply_mail_patch patch.temp ', > 'commit -a -m WebKit export of https://bugs.webkit.org/show_bug.cgi?id=1234', > 'remote ', >- 'remote add USER https://USER@github.com/USER/web-platform-tests.git', >+ 'remote add USER https://USER@github.com/USER/wpt.git', > 'remote get-url USER', > 'push USER wpt-export-for-webkit-1234:wpt-export-branch -f', > 'checkout master',
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186135
: 341662