You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know what the purpose of the failed regex created in cr_buildtrigger_repo so I'll just show the (what I believe) to be standard use case for using googleCloudRunner::cr_buildtrigger with a GitHub repo. Making a cr_trigger_repo output with the source as the sourceToBuild as well as trigger:
repo_name="StreamlineDataScience/targets-minimal"github_secret="ssh-deploy-key"sourceToBuild=googleCloudRunner::cr_buildtrigger_repo(
repo_name=repo_name,
github_secret=github_secret,
type="github"
)
googleCloudRunner::cr_buildtrigger(
build="blah.yaml",
name="blah",
trigger=sourceToBuild,
sourceToBuild=sourceToBuild)
#> Error: !grepl("[^A-Za-z0-9/.]", ref) is not TRUE
Drilldown
This drills down in different evaluations of the sub functions that are gone through before the error:
# inside cr_buildtriggerif (!is.null(sourceToBuild)) {
assertthat::assert_that(googleCloudRunner:::is.buildtrigger_repo(sourceToBuild))
sourceToBuild<-googleCloudRunner:::as.gitRepoSource(sourceToBuild)
}
#> Error: !grepl("[^A-Za-z0-9/.]", ref) is not TRUE# googleCloudRunner:::as.gitRepoSourcex=sourceToBuildref<- paste0("refs/heads/", x$repo$branchName)
ref#> [1] "refs/heads/"# 181# GitRepoSource!grepl("[^A-Za-z0-9/.]", ref) # regex not allowed#> [1] TRUE
The default for cr_buildtrigger_repo() includes a Regex for the git branch, which is fine for the trigger but sourceToBuild does not accept regex only specific branches. Some useful error messages are needed here and perhaps the default .* changed or even altered when it's being used as a sourceToBuild although it's not standard anymore what the main/master branch is called.
Short term the fix is to specify the branch or tag for the sourceToBuild
ghstreamline
pushed a commit
to muschellij2/googleCloudRunner
that referenced
this issue
Aug 4, 2022
I don't know what the purpose of the failed regex created in
cr_buildtrigger_repo
so I'll just show the (what I believe) to be standard use case for usinggoogleCloudRunner::cr_buildtrigger
with a GitHub repo. Making acr_trigger_repo
output with the source as thesourceToBuild
as well astrigger
:Drilldown
This drills down in different evaluations of the sub functions that are gone through before the error:
I don't know why this is excluded in your code as I don't see anything related to this and the docs don't indicate this: https://cloud.google.com/build/docs/api/reference/rest/v1/projects.locations.triggers#BuildTrigger.GitRepoSource
Created on 2022-02-11 by the reprex package (v2.0.1)
The text was updated successfully, but these errors were encountered: