From a97464fc1888da2d709d1f12c365245467352c50 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jan 22 2021 09:26:10 +0000 Subject: [PATCH 1/5] Fix according to dhall-zuul last master --- diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall index 3810e7c..5348023 100644 --- a/zuul.d/jobs.dhall +++ b/zuul.d/jobs.dhall @@ -144,15 +144,13 @@ let Arch = ) } -let executor_nodeset = - Zuul.Nodeset.Inline - Zuul.Nodeset::{ nodes = [] : List Zuul.Nodeset.NodeType } +let executor_nodeset = Zuul.Nodeset.Inline Zuul.Nodeset.empty let default_nodeset = Zuul.Nodeset.Name "fedora-33-container" let check_for_tests = Zuul.Job::{ - , name = Some "${job-prefix}check-for-tests" + , name = "${job-prefix}check-for-tests" , description = Some "Check the project has a tests/tests.yml" , branches = Some Branch.allText , run = Some "playbooks/rpm/check-for-tests.yaml" @@ -161,7 +159,7 @@ let check_for_tests = let check_for_arches = Zuul.Job::{ - , name = Some "${job-prefix}check-for-arches" + , name = "${job-prefix}check-for-arches" , description = Some "Check the packages needs arches builds" , branches = Some Branch.allText , run = Some "playbooks/rpm/check-for-arches.yaml" @@ -184,7 +182,7 @@ let check_for_arches = let common_koji_rpm_build = Zuul.Job::{ - , name = Some "${job-prefix}common-koji-rpm-build" + , name = "${job-prefix}common-koji-rpm-build" , abstract = Some True , protected = Some True , description = Some "Base job for RPM build on Fedora Koji" @@ -234,12 +232,12 @@ let generateRpmBuildJob = λ(branch : Branch.Type) → λ(arch : Arch.Type) → Zuul.Job::{ - , name = Some (generateRpmBuildJobName arch kbtype) + , name = generateRpmBuildJobName arch kbtype , parent = Some (Zuul.Job.getName common_koji_rpm_build) , final = Some True , dependencies = if Arch.isX86_64 arch - then None (List Zuul.Job.Dependency.union) + then None (List Zuul.Job.Dependency.Union) else Some [ Zuul.Job.Dependency.Name "${job-prefix}check-for-arches" ] , branches = Some [ Branch.show branch ] From 00f2a461d5f6a1787db5d98f5e13703e835d6e7f Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jan 22 2021 09:31:22 +0000 Subject: [PATCH 2/5] Add kojirepos definitions --- diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall index 5348023..4f45d91 100644 --- a/zuul.d/jobs.dhall +++ b/zuul.d/jobs.dhall @@ -99,6 +99,19 @@ let Branch = , Epel8 = Arch.epel8 } branch + , kojirepos = + λ(branch : Union) → + merge + { Master = + "https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/" + , F32 = + "https://kojipkgs.fedoraproject.org/repos/f32-build/latest/x86_64/" + , F33 = + "https://kojipkgs.fedoraproject.org/repos/f33-build/latest/x86_64/" + , Epel8 = + "https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/x86_64/" + } + branch , isMaster = λ(branch : Union) → merge (eq_def ⫽ { Master = True }) branch } From b29fab0d193806fb5763e3985c4c06223aba6e24 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jan 22 2021 09:44:21 +0000 Subject: [PATCH 3/5] Extracted arches and branches module in dhall Make same reusable into fedora-zuul-jobs --- diff --git a/zuul.d/dhall/arches.dhall b/zuul.d/dhall/arches.dhall new file mode 100644 index 0000000..d96c911 --- /dev/null +++ b/zuul.d/dhall/arches.dhall @@ -0,0 +1,42 @@ +let Zuul = + ~/git/softwarefactory-project.io/software-factory/dhall-zuul/package.dhall + ? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/master/package.dhall + +let Prelude = + https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e + +let Union = < X86_64 | S390X | PPC64LE | I686 | ARMV7HL | AARCH64 > + +let eq_def = + { X86_64 = False + , S390X = False + , PPC64LE = False + , I686 = False + , ARMV7HL = False + , AARCH64 = False + } + +in { Type = Union + , default = Union.X86_64 + , fedora = + [ Union.X86_64 + , Union.S390X + , Union.PPC64LE + , Union.I686 + , Union.ARMV7HL + , Union.AARCH64 + ] + , epel8 = [ Union.X86_64, Union.PPC64LE, Union.AARCH64 ] + , show = + λ(arch : Union) → + merge + { X86_64 = "x86_64" + , S390X = "s390x" + , PPC64LE = "ppc64le" + , I686 = "i686" + , ARMV7HL = "armv7hl" + , AARCH64 = "aarch64" + } + arch + , isX86_64 = λ(arch : Union) → merge (eq_def ⫽ { X86_64 = True }) arch + } diff --git a/zuul.d/dhall/branches.dhall b/zuul.d/dhall/branches.dhall new file mode 100644 index 0000000..d2c81f8 --- /dev/null +++ b/zuul.d/dhall/branches.dhall @@ -0,0 +1,57 @@ +let Zuul = + ~/git/softwarefactory-project.io/software-factory/dhall-zuul/package.dhall + ? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/master/package.dhall + +let Prelude = + https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e + +let Arches = ./arches.dhall + +let --| When changing that union, update the `all` attribute too + Union = + < Master | F32 | F33 | Epel8 > + +let eq_def = { Master = False, F32 = False, F33 = False, Epel8 = False } + +let show = + λ(branch : Union) → + merge + { Master = "master", F32 = "f32", F33 = "f33", Epel8 = "epel8" } + branch + +let all = [ Union.Master, Union.F33, Union.F32, Union.Epel8 ] + +in { Type = Union + , default = Union.Master + , all + , allText = Prelude.List.map Union Text show all + , show + , target = + λ(branch : Union) → + merge + { Master = "rawhide", F32 = "f32", F33 = "f33", Epel8 = "epel8" } + branch + , arches = + λ(branch : Union) → + merge + { Master = Arches.fedora + , F32 = Arches.fedora + , F33 = Arches.fedora + , Epel8 = Arches.epel8 + } + branch + , kojirepos = + λ(branch : Union) → + merge + { Master = + "https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/" + , F32 = + "https://kojipkgs.fedoraproject.org/repos/f32-build/latest/x86_64/" + , F33 = + "https://kojipkgs.fedoraproject.org/repos/f33-build/latest/x86_64/" + , Epel8 = + "https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/x86_64/" + } + branch + , isMaster = λ(branch : Union) → merge (eq_def ⫽ { Master = True }) branch + } diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall index 4f45d91..fd96da0 100644 --- a/zuul.d/jobs.dhall +++ b/zuul.d/jobs.dhall @@ -24,97 +24,9 @@ let --| When setting a custom prefix, redirect the output to a new file to prese job-prefix = env:JOB_PREFIX as Text ? "" -let Arch = - let Union = < X86_64 | S390X | PPC64LE | I686 | ARMV7HL | AARCH64 > - - let eq_def = - { X86_64 = False - , S390X = False - , PPC64LE = False - , I686 = False - , ARMV7HL = False - , AARCH64 = False - } - - in { Type = Union - , default = Union.X86_64 - , fedora = - [ Union.X86_64 - , Union.S390X - , Union.PPC64LE - , Union.I686 - , Union.ARMV7HL - , Union.AARCH64 - ] - , epel8 = [ Union.X86_64, Union.PPC64LE, Union.AARCH64 ] - , show = - λ(arch : Union) → - merge - { X86_64 = "x86_64" - , S390X = "s390x" - , PPC64LE = "ppc64le" - , I686 = "i686" - , ARMV7HL = "armv7hl" - , AARCH64 = "aarch64" - } - arch - , isX86_64 = λ(arch : Union) → merge (eq_def ⫽ { X86_64 = True }) arch - } - -let Branch = - let --| When changing that union, update the `all` attribute too - Union = - < Master | F32 | F33 | Epel8 > - - let eq_def = { Master = False, F32 = False, F33 = False, Epel8 = False } +let Branches = ./dhall/branches.dhall - let show = - λ(branch : Union) → - merge - { Master = "master", F32 = "f32", F33 = "f33", Epel8 = "epel8" } - branch - - let all = [ Union.Master, Union.F33, Union.F32, Union.Epel8 ] - - in { Type = Union - , default = Union.Master - , all - , allText = Prelude.List.map Union Text show all - , show - , target = - λ(branch : Union) → - merge - { Master = "rawhide" - , F32 = "f32" - , F33 = "f33" - , Epel8 = "epel8" - } - branch - , arches = - λ(branch : Union) → - merge - { Master = Arch.fedora - , F32 = Arch.fedora - , F33 = Arch.fedora - , Epel8 = Arch.epel8 - } - branch - , kojirepos = - λ(branch : Union) → - merge - { Master = - "https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/" - , F32 = - "https://kojipkgs.fedoraproject.org/repos/f32-build/latest/x86_64/" - , F33 = - "https://kojipkgs.fedoraproject.org/repos/f33-build/latest/x86_64/" - , Epel8 = - "https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/x86_64/" - } - branch - , isMaster = - λ(branch : Union) → merge (eq_def ⫽ { Master = True }) branch - } +let Arches = ./dhall/arches.dhall let KojiBuild = let Union = < Scratch | Final > @@ -129,10 +41,11 @@ let KojiBuild = } let generateRpmBuildJobName - : Arch.Type → KojiBuild.Type → Text - = λ(arch : Arch.Type) → + : Arches.Type → KojiBuild.Type → Text + = λ(arch : Arches.Type) → λ(kbtype : KojiBuild.Type) → - let suffix = if Arch.isX86_64 arch then "" else "-" ++ Arch.show arch + let suffix = + if Arches.isX86_64 arch then "" else "-" ++ Arches.show arch let name = if KojiBuild.isScratch kbtype @@ -142,17 +55,17 @@ let generateRpmBuildJobName in job-prefix ++ name let Arch = - Arch + Arches ⫽ { extras = Prelude.List.filter - Arch.Type - (λ(arch : Arch.Type) → Prelude.Bool.not (Arch.isX86_64 arch)) - Arch.fedora + Arches.Type + (λ(arch : Arches.Type) → Prelude.Bool.not (Arches.isX86_64 arch)) + Arches.fedora , scratch-job-names = Prelude.List.map - Arch.Type + Arches.Type Text - ( λ(arch : Arch.Type) → + ( λ(arch : Arches.Type) → generateRpmBuildJobName arch KojiBuild.Type.Scratch ) } @@ -165,7 +78,7 @@ let check_for_tests = Zuul.Job::{ , name = "${job-prefix}check-for-tests" , description = Some "Check the project has a tests/tests.yml" - , branches = Some Branch.allText + , branches = Some Branches.allText , run = Some "playbooks/rpm/check-for-tests.yaml" , nodeset = Some executor_nodeset } @@ -174,7 +87,7 @@ let check_for_arches = Zuul.Job::{ , name = "${job-prefix}check-for-arches" , description = Some "Check the packages needs arches builds" - , branches = Some Branch.allText + , branches = Some Branches.allText , run = Some "playbooks/rpm/check-for-arches.yaml" , vars = Some ( Zuul.Vars.object @@ -242,7 +155,7 @@ let doFetchArtifact let generateRpmBuildJob = λ(kbtype : KojiBuild.Type) → - λ(branch : Branch.Type) → + λ(branch : Branches.Type) → λ(arch : Arch.Type) → Zuul.Job::{ , name = generateRpmBuildJobName arch kbtype @@ -253,11 +166,11 @@ let generateRpmBuildJob = then None (List Zuul.Job.Dependency.Union) else Some [ Zuul.Job.Dependency.Name "${job-prefix}check-for-arches" ] - , branches = Some [ Branch.show branch ] + , branches = Some [ Branches.show branch ] , vars = Some ( setVars - (Branch.target branch) - (Branch.show branch) + (Branches.target branch) + (Branches.show branch) (Arch.show arch) (KojiBuild.isScratch kbtype) (doFetchArtifact arch kbtype) @@ -268,21 +181,21 @@ let generateRpmBuildJobs : KojiBuild.Type → List Zuul.Job.Type = λ(kbtype : KojiBuild.Type) → let forBranch = - λ(branch : Branch.Type) → + λ(branch : Branches.Type) → Prelude.List.map Arch.Type Zuul.Job.Type (generateRpmBuildJob kbtype branch) ( if KojiBuild.isScratch kbtype - then Branch.arches branch + then Branches.arches branch else [ Arch.Type.X86_64 ] ) in Prelude.List.concatMap - Branch.Type + Branches.Type Zuul.Job.Type forBranch - Branch.all + Branches.all let Jobs = [ check_for_tests, check_for_arches, common_koji_rpm_build ] From c14291149a9247e946780d368f4a82a8a8836baa Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jan 22 2021 10:17:04 +0000 Subject: [PATCH 4/5] dhall: add isEpel8 test --- diff --git a/zuul.d/dhall/branches.dhall b/zuul.d/dhall/branches.dhall index d2c81f8..87802f1 100644 --- a/zuul.d/dhall/branches.dhall +++ b/zuul.d/dhall/branches.dhall @@ -54,4 +54,5 @@ in { Type = Union } branch , isMaster = λ(branch : Union) → merge (eq_def ⫽ { Master = True }) branch + , isEpel8 = λ(branch : Union) → merge (eq_def ⫽ { Epel8 = True }) branch } From 033460dc1e888a6c9c0c6f8fa3d13b5eca17ee54 Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Jan 25 2021 10:12:12 +0000 Subject: [PATCH 5/5] Use fedora-project-config FZCI.dhall package --- diff --git a/zuul.d/dhall/arches.dhall b/zuul.d/dhall/arches.dhall deleted file mode 100644 index d96c911..0000000 --- a/zuul.d/dhall/arches.dhall +++ /dev/null @@ -1,42 +0,0 @@ -let Zuul = - ~/git/softwarefactory-project.io/software-factory/dhall-zuul/package.dhall - ? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/master/package.dhall - -let Prelude = - https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e - -let Union = < X86_64 | S390X | PPC64LE | I686 | ARMV7HL | AARCH64 > - -let eq_def = - { X86_64 = False - , S390X = False - , PPC64LE = False - , I686 = False - , ARMV7HL = False - , AARCH64 = False - } - -in { Type = Union - , default = Union.X86_64 - , fedora = - [ Union.X86_64 - , Union.S390X - , Union.PPC64LE - , Union.I686 - , Union.ARMV7HL - , Union.AARCH64 - ] - , epel8 = [ Union.X86_64, Union.PPC64LE, Union.AARCH64 ] - , show = - λ(arch : Union) → - merge - { X86_64 = "x86_64" - , S390X = "s390x" - , PPC64LE = "ppc64le" - , I686 = "i686" - , ARMV7HL = "armv7hl" - , AARCH64 = "aarch64" - } - arch - , isX86_64 = λ(arch : Union) → merge (eq_def ⫽ { X86_64 = True }) arch - } diff --git a/zuul.d/dhall/branches.dhall b/zuul.d/dhall/branches.dhall deleted file mode 100644 index 87802f1..0000000 --- a/zuul.d/dhall/branches.dhall +++ /dev/null @@ -1,58 +0,0 @@ -let Zuul = - ~/git/softwarefactory-project.io/software-factory/dhall-zuul/package.dhall - ? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/master/package.dhall - -let Prelude = - https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e - -let Arches = ./arches.dhall - -let --| When changing that union, update the `all` attribute too - Union = - < Master | F32 | F33 | Epel8 > - -let eq_def = { Master = False, F32 = False, F33 = False, Epel8 = False } - -let show = - λ(branch : Union) → - merge - { Master = "master", F32 = "f32", F33 = "f33", Epel8 = "epel8" } - branch - -let all = [ Union.Master, Union.F33, Union.F32, Union.Epel8 ] - -in { Type = Union - , default = Union.Master - , all - , allText = Prelude.List.map Union Text show all - , show - , target = - λ(branch : Union) → - merge - { Master = "rawhide", F32 = "f32", F33 = "f33", Epel8 = "epel8" } - branch - , arches = - λ(branch : Union) → - merge - { Master = Arches.fedora - , F32 = Arches.fedora - , F33 = Arches.fedora - , Epel8 = Arches.epel8 - } - branch - , kojirepos = - λ(branch : Union) → - merge - { Master = - "https://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/" - , F32 = - "https://kojipkgs.fedoraproject.org/repos/f32-build/latest/x86_64/" - , F33 = - "https://kojipkgs.fedoraproject.org/repos/f33-build/latest/x86_64/" - , Epel8 = - "https://kojipkgs.fedoraproject.org/repos/epel8-build/latest/x86_64/" - } - branch - , isMaster = λ(branch : Union) → merge (eq_def ⫽ { Master = True }) branch - , isEpel8 = λ(branch : Union) → merge (eq_def ⫽ { Epel8 = True }) branch - } diff --git a/zuul.d/jobs.dhall b/zuul.d/jobs.dhall index fd96da0..e275516 100644 --- a/zuul.d/jobs.dhall +++ b/zuul.d/jobs.dhall @@ -15,7 +15,7 @@ Install zuulfmt by running: `python3 -mpip install --user zuulfmt` let Zuul = ~/git/softwarefactory-project.io/software-factory/dhall-zuul/package.dhall - ? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/master/package.dhall + ? https://softwarefactory-project.io/cgit/software-factory/dhall-zuul/plain/package.dhall?h=0.4.0 sha256:1e74901df84e6428f15cbe6cac4f66be41030addb689177c14cbbd8f8802e77c let Prelude = https://prelude.dhall-lang.org/v17.0.0/package.dhall sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e @@ -24,9 +24,13 @@ let --| When setting a custom prefix, redirect the output to a new file to prese job-prefix = env:JOB_PREFIX as Text ? "" -let Branches = ./dhall/branches.dhall +let FZCI = ~/git/pagure.io/fedora-project-config/FZCI.dhall/package.dhall -let Arches = ./dhall/arches.dhall +let Branches = FZCI.Branches + +let Arches = FZCI.Arches + +let Nodesets = FZCI.Nodesets let KojiBuild = let Union = < Scratch | Final > @@ -72,7 +76,7 @@ let Arch = let executor_nodeset = Zuul.Nodeset.Inline Zuul.Nodeset.empty -let default_nodeset = Zuul.Nodeset.Name "fedora-33-container" +let default_nodeset = Nodesets.getName Nodesets.Type.Fedora-33-Container let check_for_tests = Zuul.Job::{