-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cope with missing
version
attribute on module (#139)
Cope with missing `version` attribute on module --------- Co-authored-by: Derek Cormier <[email protected]>
- Loading branch information
Showing
13 changed files
with
218 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,21 +170,21 @@ modules/unversioned/1.0.0/MODULE.bazel | |
---------------------------------------------------- | ||
module( | ||
name = \\"unversioned\\", | ||
version = \\"1.0.0\\", | ||
version = \\"1.0.0\\", | ||
) | ||
---------------------------------------------------- | ||
modules/unversioned/1.0.0/patches/module_dot_bazel_version.patch | ||
---------------------------------------------------- | ||
=================================================================== | ||
--- a/MODULE.bazel | ||
+++ b/MODULE.bazel | ||
@@ -1,4 +1,4 @@ | ||
@@ -1,3 +1,4 @@ | ||
module( | ||
name = \\"unversioned\\", | ||
- version = \\"0.0.0\\", | ||
+ version = \\"1.0.0\\", | ||
- name = \\"unversioned\\" | ||
+ name = \\"unversioned\\", | ||
+ version = \\"1.0.0\\", | ||
) | ||
\\\\ No newline at end of file | ||
---------------------------------------------------- | ||
modules/unversioned/1.0.0/presubmit.yml | ||
|
@@ -204,11 +204,11 @@ bcr_test_module: | |
modules/unversioned/1.0.0/source.json | ||
---------------------------------------------------- | ||
{ | ||
\\"integrity\\": \\"sha256-eXQOU+DNwg/Q29tX59jP0+SFLvRHrQf3z+KJVS/gIRk=\\", | ||
\\"integrity\\": \\"sha256-oLg/mgWyhr6DFepRYkjoPphQ8KOriLgu6M4x2RSsLbU=\\", | ||
\\"strip_prefix\\": \\"unversioned-1.0.0\\", | ||
\\"url\\": \\"https://github.com/testorg/unversioned/archive/refs/tags/v1.0.0.tar.gz\\", | ||
\\"patches\\": { | ||
\\"module_dot_bazel_version.patch\\": \\"sha256-y0kC8heeH9bQKhrfx2JuX+RK0KyjwHhPac3wBc4Nkg4=\\" | ||
\\"module_dot_bazel_version.patch\\": \\"sha256-LGXyh9FLhgIPbe0gHfxAPnEQ7HVR+HUP/IDbPdl3ZkA=\\" | ||
}, | ||
\\"patch_strip\\": 1 | ||
} | ||
|
@@ -292,6 +292,79 @@ modules/versioned/metadata.json | |
" | ||
`; | ||
|
||
exports[`e2e tests [snapshot] ruleset with zero-versioned module in source 1`] = ` | ||
"---------------------------------------------------- | ||
modules/zero-versioned/1.0.0/MODULE.bazel | ||
---------------------------------------------------- | ||
module( | ||
name = \\"zero-versioned\\", | ||
version = \\"1.0.0\\", | ||
) | ||
---------------------------------------------------- | ||
modules/zero-versioned/1.0.0/patches/module_dot_bazel_version.patch | ||
---------------------------------------------------- | ||
=================================================================== | ||
--- a/MODULE.bazel | ||
+++ b/MODULE.bazel | ||
@@ -1,4 +1,4 @@ | ||
module( | ||
name = \\"zero-versioned\\", | ||
- version = \\"0.0.0\\", | ||
+ version = \\"1.0.0\\", | ||
) | ||
---------------------------------------------------- | ||
modules/zero-versioned/1.0.0/presubmit.yml | ||
---------------------------------------------------- | ||
bcr_test_module: | ||
module_path: \\"e2e/bzlmod\\" | ||
matrix: | ||
platform: [\\"debian10\\", \\"macos\\", \\"ubuntu2004\\", \\"windows\\"] | ||
tasks: | ||
run_tests: | ||
name: \\"Run test module\\" | ||
platform: \${{ platform }} | ||
test_targets: | ||
- \\"//...\\" | ||
---------------------------------------------------- | ||
modules/zero-versioned/1.0.0/source.json | ||
---------------------------------------------------- | ||
{ | ||
\\"integrity\\": \\"sha256-sLh05DKTEOuO3vz9+IDUJJNOf0GSLxdGDJ8qOLZRUCQ=\\", | ||
\\"strip_prefix\\": \\"zero-versioned-1.0.0\\", | ||
\\"url\\": \\"https://github.com/testorg/zero-versioned/archive/refs/tags/v1.0.0.tar.gz\\", | ||
\\"patches\\": { | ||
\\"module_dot_bazel_version.patch\\": \\"sha256-KpbuC1vv5mfhdTs5nnTl3/pH7Y/6JCnD1b1XLsqyOAo=\\" | ||
}, | ||
\\"patch_strip\\": 1 | ||
} | ||
---------------------------------------------------- | ||
modules/zero-versioned/metadata.json | ||
---------------------------------------------------- | ||
{ | ||
\\"homepage\\": \\"https://github.com/testorg/zero-versioned\\", | ||
\\"maintainers\\": [ | ||
{ | ||
\\"name\\": \\"Foo McBar\\", | ||
\\"email\\": \\"[email protected]\\", | ||
\\"github\\": \\"foobar\\" | ||
} | ||
], | ||
\\"repository\\": [ | ||
\\"github:testorg/zero-versioned\\" | ||
], | ||
\\"versions\\": [ | ||
\\"1.0.0\\" | ||
], | ||
\\"yanked_versions\\": {} | ||
} | ||
" | ||
`; | ||
|
||
exports[`e2e tests [snapshot] ruleset with zip release archive 1`] = ` | ||
"---------------------------------------------------- | ||
modules/zip/1.0.0/MODULE.bazel | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
module( | ||
name = "unversioned", | ||
version = "0.0.0", | ||
) | ||
name = "unversioned" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
Ruleset repo that doesn't update the source MODULE.bazel's `version` field. | ||
Ruleset repo that doesn't have the source MODULE.bazel's `version` field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"homepage": "https://github.com/testorg/zero-versioned", | ||
"maintainers": [ | ||
{ | ||
"name": "Foo McBar", | ||
"email": "[email protected]", | ||
"github": "foobar" | ||
} | ||
], | ||
"repository": [ | ||
"github:testorg/zero-versioned" | ||
], | ||
"versions": [], | ||
"yanked_versions": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
bcr_test_module: | ||
module_path: "e2e/bzlmod" | ||
matrix: | ||
platform: ["debian10", "macos", "ubuntu2004", "windows"] | ||
tasks: | ||
run_tests: | ||
name: "Run test module" | ||
platform: ${{ platform }} | ||
test_targets: | ||
- "//..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"integrity": "", | ||
"strip_prefix": "{REPO}-{VERSION}", | ||
"url": "https://github.com/{OWNER}/{REPO}/archive/refs/tags/{TAG}.tar.gz" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module( | ||
name = "zero-versioned", | ||
version = "0.0.0", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Ruleset repo that doesn't set the source MODULE.bazel's `version` field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters