diff --git a/config-prod.yml b/config-prod.yml index 53f7c15..b2df56e 100644 --- a/config-prod.yml +++ b/config-prod.yml @@ -11,16 +11,19 @@ projects: rakudo: project: rakudo repo: rakudo + main: main slug: rakudo/rakudo install-id: 20243470 nqp: project: Raku repo: nqp + main: main slug: Raku/nqp install-id: 20243470 moar: project: MoarVM repo: MoarVM + main: master slug: MoarVM/MoarVM install-id: 20243470 diff --git a/lib/Config.rakumod b/lib/Config.rakumod index 6a2e532..d27dfee 100644 --- a/lib/Config.rakumod +++ b/lib/Config.rakumod @@ -4,6 +4,7 @@ class ConfigProject { has $.project; has $.repo; has $.slug; + has $.main; has $.repo-url; has $.install-id; @@ -12,6 +13,7 @@ class ConfigProject { project => %config, repo => %config, slug => %config ~ "/" ~ %config, + main => %config
, repo-url => %config, install-id => %config, ; diff --git a/lib/SourceArchiveCreator.rakumod b/lib/SourceArchiveCreator.rakumod index aecfaa6..0772bce 100644 --- a/lib/SourceArchiveCreator.rakumod +++ b/lib/SourceArchiveCreator.rakumod @@ -121,26 +121,26 @@ method create-archive(SourceSpec $source-spec --> Str) { } my @shas; - for $!rakudo-dir, $source-spec.rakudo-git-url, $source-spec.rakudo-commit-sha, - $!nqp-dir, $source-spec.nqp-git-url, $source-spec.nqp-commit-sha, - $!moar-dir, $source-spec.moar-git-url, $source-spec.moar-commit-sha - -> $repo-dir, $remote, $commit { + for $!rakudo-dir, $source-spec.rakudo-git-url, $source-spec.rakudo-commit-sha, config.projects.rakudo.main, + $!nqp-dir, $source-spec.nqp-git-url, $source-spec.nqp-commit-sha, config.projects.nqp.main, + $!moar-dir, $source-spec.moar-git-url, $source-spec.moar-commit-sha, config.projects.moar.main + -> $repo-dir, $remote, $commit, $main { debug "SourceArchiveCreator: working on " ~ $remote ~ " " ~ $commit; + my $tmp-branch = 'tmp-branch'; - run(qw|git remote rm foobar|, + run(qw|git remote rm|, $tmp-branch, :cwd($repo-dir), :merge).so; - validate run qw|git remote add foobar|, $remote, + validate run qw|git remote add|, $tmp-branch, $remote, :cwd($repo-dir), :merge; - #validate run qw|git fetch foobar|, |($.fetch-ref ?? ("+refs/" ~ $.fetch-ref ~ ":refs/remotes/" ~ $.fetch-ref,) !! ()), - validate run qw|git fetch foobar|, + #validate run qw|git fetch|, $tmp-branch, |($.fetch-ref ?? ("+refs/" ~ $.fetch-ref ~ ":refs/remotes/" ~ $.fetch-ref,) !! ()), + validate run qw|git fetch|, $tmp-branch, :cwd($repo-dir), :merge; - # TODO no hard coded master branch. - my $to-use = $commit eq 'LATEST' ?? 'foobar/master' !! $commit; + my $ref = $commit eq 'LATEST' ?? "$tmp-branch/$main" !! $commit; - validate run qw|git reset --hard|, $to-use, + validate run qw|git reset --hard|, $ref, :cwd($repo-dir), :merge; # updating submodules diff --git a/t/GitHubInterface.rakutest b/t/GitHubInterface.rakutest index 0873116..0326994 100644 --- a/t/GitHubInterface.rakutest +++ b/t/GitHubInterface.rakutest @@ -20,7 +20,6 @@ check-mock($processor, $_.number == 3 && $_.user-url eq "https://github.com/patrickbkr/GitHub-API-Testing/pull/3" && $_.comments[0].body eq "Some description." - && $_.head-url eq "https://github.com/patrickbkr/GitHub-API-Testing.git" && $_.base-url eq "https://github.com/patrickbkr/GitHub-API-Testing.git" && $_.head-branch eq "feature-branch-1" && $_.commit-task.commit-sha eq "f2b9e0fca8ad20c14bdc188240918720613d2cee" diff --git a/t/data/config-test.yml b/t/data/config-test.yml index c97a60d..c98b38a 100644 --- a/t/data/config-test.yml +++ b/t/data/config-test.yml @@ -11,16 +11,19 @@ projects: rakudo: project: rakudo repo: rakudo + main: main repo-url: https://github.com/rakudo/rakudo.git install-id: 20243470 nqp: project: Raku repo: nqp + main: main repo-url: https://github.com/nqp/nqp.git install-id: 20243470 moar: project: MoarVM repo: MoarVM + main: master repo-url: https://github.com/MoarVM/MoarVM.git install-id: 20243470