-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(multi-repo): require tag or branch in repository URLs
BREAKING CHANGES: Repository URLs now must contain a hash part pointing to a specific branch or tag. E.g: https://github.com/org/repo.git#master All garden.yml config files that contain a repositoryUrl key must be updated accordingly.
- Loading branch information
Showing
10 changed files
with
103 additions
and
60 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
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
2 changes: 1 addition & 1 deletion
2
garden-service/test/data/test-project-ext-module-sources/module-a/garden.yml
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
2 changes: 1 addition & 1 deletion
2
garden-service/test/data/test-project-ext-module-sources/module-b/garden.yml
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
2 changes: 1 addition & 1 deletion
2
garden-service/test/data/test-project-ext-module-sources/module-c/garden.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { expect } from "chai" | ||
import dedent = require("dedent") | ||
|
||
import { expectError } from "../../helpers" | ||
import { getCommitIdFromRefList, parseGitUrl } from "../../../src/vcs/git" | ||
|
||
describe("git", () => { | ||
describe("getCommitIdFromRefList", () => { | ||
it("should get the commit id from a list of commit ids and refs", () => { | ||
const refList = dedent` | ||
abcde ref/heads/master | ||
1234 ref/heads/master | ||
foobar ref/heads/master | ||
` | ||
expect(getCommitIdFromRefList(refList)).to.equal("abcde") | ||
}) | ||
it("should get the commit id from a list of commit ids without refs", () => { | ||
const refList = dedent` | ||
abcde | ||
1234 ref/heads/master | ||
foobar ref/heads/master | ||
` | ||
expect(getCommitIdFromRefList(refList)).to.equal("abcde") | ||
}) | ||
it("should get the commit id from a single commit id / ref pair", () => { | ||
const refList = "abcde ref/heads/master" | ||
expect(getCommitIdFromRefList(refList)).to.equal("abcde") | ||
}) | ||
it("should get the commit id from single commit id without a ref", () => { | ||
const refList = "abcde" | ||
expect(getCommitIdFromRefList(refList)).to.equal("abcde") | ||
}) | ||
}) | ||
describe("parseGitUrl", () => { | ||
it("should return the url part and the hash part from a github url", () => { | ||
const url = "https://github.com/org/repo.git#branch" | ||
expect(parseGitUrl(url)).to.eql({ repositoryUrl: "https://github.com/org/repo.git", hash: "branch" }) | ||
}) | ||
it("should throw a configuration error if the hash part is missing", async () => { | ||
const url = "https://github.com/org/repo.git" | ||
await expectError(() => parseGitUrl(url), "configuration") | ||
}) | ||
}) | ||
}) |