Skip to content

Commit

Permalink
io.schema: Remove repo URL from revision IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
spbnick committed Jun 25, 2020
1 parent 8538ad8 commit 68ac500
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 43 deletions.
12 changes: 6 additions & 6 deletions kcidb/io/schema/test_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def test_origin(self):
version=dict(major=VERSION.previous.major,
minor=VERSION.previous.minor),
revisions=[
dict(id="origin1:git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e"),
dict(id="origin1:5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e"),
],
builds=[
dict(revision_id="origin1:git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
dict(revision_id="origin1:5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
id="origin2:1"),
dict(revision_id="origin1:git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
dict(revision_id="origin1:5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
id="origin3:2"),
],
tests=[
Expand All @@ -41,14 +41,14 @@ def test_origin(self):
version=dict(major=VERSION.major,
minor=VERSION.minor),
revisions=[
dict(id="git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
dict(id="5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
origin="origin1")
],
builds=[
dict(revision_id="git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
dict(revision_id="5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
id="origin2:1",
origin="origin2"),
dict(revision_id="git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
dict(revision_id="5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
id="origin3:2",
origin="origin3"),
],
Expand Down
28 changes: 9 additions & 19 deletions kcidb/io/schema/v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@

# A regular expression pattern matching strings containing revision IDs
REVISION_ID_PATTERN = \
f"{GIT_REPOSITORY_URL_PATTERN}" \
f"@{GIT_REPOSITORY_COMMIT_HASH_PATTERN}" \
f"{GIT_REPOSITORY_COMMIT_HASH_PATTERN}" \
f"(\\+{SHA256_PATTERN})?"

# A regular expression pattern matching strings containing origin name
Expand Down Expand Up @@ -96,29 +95,20 @@
"description":
"Revision ID.\n"
"\n"
"Must be a string containing the following, in order.\n"
"\n"
"The URL of the Git repository which contains the base code "
"of the revision. The shortest possible https:// URL, or, if "
"that's not available, the shortest possible git:// URL."
"\n"
"The '@' character.\n"
"\n"
"The full commit hash of the revision's base code in the Git "
"repository.\n"
"Must contain the full commit hash of the revision's base "
"code in the Git repository.\n"
"\n"
"If the revision had patches applied to the base code, "
"the '+' character, followed by a sha256 hash over "
"newline-terminated sha256 hashes of each applied patch, "
"in order. E.g. generated with this shell command: \""
"the commit hash should be followed by the '+' character "
"and a sha256 hash over newline-terminated sha256 hashes of "
"each applied patch, in order. E.g. generated with this "
"shell command: \""
"sha256sum *.patch | cut -c-64 | sha256sum | cut -c-64"
"\".\n",
"pattern": f"^{REVISION_ID_PATTERN}$",
"examples": [
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/" +
"linux-stable.git@aa73bcc376865c23e61dcebd467697b527901be8",
"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/" +
"linux.git@c0d73a868d9b411bd2d0c8e5ff9d98bfa8563cb1" +
"aa73bcc376865c23e61dcebd467697b527901be8",
"c0d73a868d9b411bd2d0c8e5ff9d98bfa8563cb1" +
"+903638c087335b10293663c682b9aa0076f9f7be478a8e782" +
"8bc22e12d301b42"
],
Expand Down
6 changes: 3 additions & 3 deletions kcidb/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_min(self):
"misc": {
"pipeline_id": 467715
},
"id": "https://git.kernel.org/@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"id": "5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"origin": "origin",
"patch_mboxes": [],
"valid": True,
Expand All @@ -60,8 +60,8 @@ def test_min(self):
notification_message)
self.assertEqual(notification.id,
"subscription:revisions:"
"aHR0cHM6Ly9naXQua2VybmVsLm9yZy9ANWUyOWQxNDQzYzQ2Yj"
"ZjYTcwYTRjOTQwYTY3ZThjMDlmMDVkY2I3ZQ==:aWQ=")
"NWUyOWQxNDQzYzQ2YjZjYTcwYTRjOTQwYTY3ZThjMDlmMDVkY2"
"I3ZQ==:aWQ=")
message = notification.render()
self.assertIsInstance(message, email.message.EmailMessage)
self.assertIsNone(message['From'])
Expand Down
19 changes: 8 additions & 11 deletions kcidb/test_oo.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@

IO_REVISION1 = {
"id":
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/"
"linux-stable.git@aa73bcc376865c23e61dcebd467697b527901be8",
"aa73bcc376865c23e61dcebd467697b527901be8",
"origin":
"origin",
}

IO_REVISION2 = {
"id":
"https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/"
"linux.git@c0d73a868d9b411bd2d0c8e5ff9d98bfa8563cb1"
"c0d73a868d9b411bd2d0c8e5ff9d98bfa8563cb1"
"+903638c087335b10293663c682b9aa0076f9f7be478a8e782"
"8bc22e12d301b42",
"origin":
Expand All @@ -30,8 +28,7 @@

IO_REVISION3 = {
"id":
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/"
"linux-stable.git@7f74c309d3e46088e6606183d15aba89539b650d",
"7f74c309d3e46088e6606183d15aba89539b650d",
"origin":
"origin",
}
Expand Down Expand Up @@ -78,7 +75,7 @@ def test_revision(self):
"misc": {
"pipeline_id": 467715
},
"id": "git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"id": "5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"origin": "redhat",
"patch_mboxes": [],
"valid": True,
Expand All @@ -89,7 +86,7 @@ def test_revision(self):
expected_oo_data = {
"version": self.version,
"revisions": {
"git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e":
"5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e":
Revision({}, {
"contacts": [
"[email protected]"
Expand All @@ -101,7 +98,7 @@ def test_revision(self):
"misc": {
"pipeline_id": 467715
},
"id": "git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"id": "5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"origin": "redhat",
"patch_mboxes": [],
"valid": True,
Expand Down Expand Up @@ -135,7 +132,7 @@ def test_build(self):
"pipeline_id": 469720
},
"output_files": [],
"revision_id": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git@1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"revision_id": "1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"start_time": "2020-03-03T17:52:02.370000+00:00",
"valid": True
},
Expand All @@ -161,7 +158,7 @@ def test_build(self):
"pipeline_id": 469720
},
"output_files": [],
"revision_id": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git@1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"revision_id": "1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"start_time": "2020-03-03T17:52:02.370000+00:00",
"valid": True,
"revision_": None,
Expand Down
8 changes: 4 additions & 4 deletions kcidb/test_subscriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def test_min(self):
"misc": {
"pipeline_id": 467715
},
"id": "https://git.kernel.org/@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"id": "5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"origin": "non_test",
"patch_mboxes": [],
"valid": True,
Expand All @@ -56,7 +56,7 @@ def test_min(self):
"misc": {
"pipeline_id": 467715
},
"id": "https://git.kernel.org/@1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"id": "1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"origin": "test",
"patch_mboxes": [],
"valid": True,
Expand All @@ -78,7 +78,7 @@ def test_min(self):
"pipeline_id": 469720
},
"output_files": [],
"revision_id": "https://git.kernel.org/@5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"revision_id": "5e29d1443c46b6ca70a4c940a67e8c09f05dcb7e",
"start_time": "2020-03-03T17:52:02.370000+00:00",
"valid": True
},
Expand All @@ -97,7 +97,7 @@ def test_min(self):
"pipeline_id": 469720
},
"output_files": [],
"revision_id": "https://git.kernel.org/@1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"revision_id": "1254e88b4fc1470d152f494c3590bb6a33ab33eb",
"start_time": "2020-03-03T17:52:02.370000+00:00",
"valid": True
},
Expand Down

0 comments on commit 68ac500

Please sign in to comment.