@@ -2,6 +2,7 @@ package main
22
33import (
44 "encoding/json"
5+ "flag"
56 "fmt"
67 "go/ast"
78 "go/parser"
@@ -35,7 +36,7 @@ func checkTemplateContract() {
3536 if err := json .Unmarshal (manifestBytes , & contract ); err != nil {
3637 failf ("decode manifest: %v" , err )
3738 }
38- if contract .SchemaVersion != 1 || contract .BuildProfile != "go-react-v1" || contract .TemplateVersion != "1.9.0 " || contract .MinimumSandboxImageContractRevision != 3 {
39+ if contract .SchemaVersion != 1 || contract .BuildProfile != "go-react-v1" || contract .TemplateVersion != "1.9.1 " || contract .MinimumSandboxImageContractRevision != 3 {
3940 failf ("unexpected template identity: %+v" , contract )
4041 }
4142 if baseline := strings .TrimSpace (readFile (filepath .Join (root , "DEX_SERVER_BASELINE" ))); baseline != "server/v0.14.1" {
@@ -164,6 +165,11 @@ func checkTemplateContract() {
164165 failf ("Dex dependency updater does not mention %q" , required )
165166 }
166167 }
168+ }
169+
170+ // Template publishing automation belongs to the template repository, not exported apps.
171+ func checkTemplateRepositoryAutomation () {
172+ root := "."
167173 updateWorkflow := readFile (filepath .Join (root , ".github" , "workflows" , "update-dex-dependencies.yml" ))
168174 for _ , required := range []string {
169175 "schedule:" ,
@@ -287,9 +293,17 @@ func readFile(path string) string {
287293
288294// Static repository validation is separate from API integration tests.
289295func main () {
296+ repositoryAutomation := flag .Bool ("repository-automation" , false , "also validate template-owned release/update workflows" )
297+ flag .Parse ()
298+ if flag .NArg () != 0 {
299+ failf ("unexpected positional arguments" )
300+ }
290301 checkTemplateContract ()
291302 checkGoNamesDescribeConcreteResponsibilities ()
292303 checkTestPolicy ()
304+ if * repositoryAutomation {
305+ checkTemplateRepositoryAutomation ()
306+ }
293307 fmt .Println ("Template contract, Go names, and integration-only test policy are valid." )
294308}
295309
0 commit comments