Bug #2783

consider variable restrict-to-slaves for prepare/finish hooks as well

Added by R. Haschke over 5 years ago. Updated over 5 years ago.

Status:ResolvedStart date:11/11/2018
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Data Model
Target version:0.25

Description

For preparing our distro for Bionic, I wanted to build an existing distribution on a bionic machine, using the restrict-to-slaves variable on cmdline.
While this works fine for "normal" jobs, prepare/finish hooks do not consider this variable.
My attempts to fix this (in branch restrict-to-slaves-for-hooks) were not successful. These hooks do not even show up, when tracing the variable.

Btw, looking into this, I noticed that we have lots of different notations for the very same variable, e.g. {kind, build-job.kind} or {build-job.name, build-job-name}.
It would be nice, to state which ones are actually used and which ones are deprecated...

Associated revisions

Revision f5bcf1fb
Added by J. Moringen over 5 years ago

Never instantiate project-specs in src/model/project/*.lisp

This changes the project model from

distribution-spec -------+
              |                        |
v v
template <--- project-spec ..........> project | | |
v v v
aspect-spec version-spec ..........> version | |
v v
job-spec ..............> job

to

distribution-spec .....> distribution
                                       |
                                       |
template <--- project-spec | | | |
v v v
aspect-spec version-spec ..........> version | |
v v
job-spec ..............> job

This has multiple consequences:

  • Lot's of code can be removed or simplified.
  • Project versions can be parameterized differently in different
    distributions within the same generate execution.
  • Orchestration jobs are configured in a way similar to real projects
    making the behavior more uniform. In particular, variable overwrites
    specified on the commandline are now picked up within orchestration
    jobs and aspects.

fixes #2783

  • src/model/project/classes-spec.lisp (distribution-spec): added
    superclass `specification-mixin'
    (instantiate distribution-spec): new method; create a `distribution'
    instance containing `version' instances
    (project-spec): removed superclass `parented-mixin'
    (variables :around project-spec): no need to collect parent's
    variables
    (lookup project-spec t): similar
    (instantiate project-spec): removed; no longer needed
    (instantiate version-spec): pass specification to new `version'
    instance
    (instantiate job-spec): similar for new `job-spec'
  • src/model/project/classes-model.lisp (distribution): new class;
    result of instantiating a `distribution-spec'
    (lookup distribution t): new method; delegate variable lookup to
    specification
    (persons-in-role t distribution): new method; delegate to
    specification
    (project): removed; no longer needed
    (direct-variables project): likewise
    (lookup project t): likewise
    (add-dependencies! project project-spec): likewise
    (deploy project): likewise
    (print-items append version): new method; print distribution,
    project and version names
    (lookup version t): new method; look up variables in specification
    and maybe in parent, i.e. distribution
    (lookup job t): new method; lookup variables in specification and
    parent
  • src/model/project/progress.lisp (header): updated copyright
    (deploy :around project): removed method; no longer needed
    (deploy :around version): removed unnecessary `progress' call
  • src/report/graphviz.lisp
    (graph-object-node jenkins-dependencies distribution): changed
    specializer distribution-spec -> distribution
    (graph-object-points-to jenkins-dependencies distribution-spec):
    likewise
    (graph-object-points-to jenkins-dependencies project): removed
    method; no longer needed
    (object-filename distribution): changed specializer
    distribution-spec -> distribution
    (report sequence eql :graph pathname): works on `distribution'
    instead of `distribution-spec' now
    (report version-spec eql :graph pathname): removed method; no longer
    needed
  • src/report/catalog.lisp (catalog-description): works on
    `distribution' instead of `distribution-spec' now
    (project-version-name): adapted to changed project model
    (report distribution catalog pathname): changed specializer
    distribution-spec -> distribution; simplified
    (report distribution catalog stream): similar
    (report t eql :catalog t): works on `distribution' instead of
    `distribution-spec' now
  • src/commands/functions-input.lisp (locate-projects): do not
    associate distributions with `project-spec' instances; those are
    independent now
    (project-spec-and-versions): removed; no longer needed
    (print-items append project-spec-and-versions): likewise
    (load-project/versioned): removed distribution parameter; returned
    `project-spec' instance does not have a parent; return
    `project-spec' instance directly, without `project-spec-and-versions'
    (load-projects/versioned): accordingly
    (group-project-versions-for-analysis): process a `project-spec'
    instead of a `project-spec-and-versions'
  • src/commands/functions-deploy.lisp (instantiate-projects): removed;
    no longer needed
    (deploy-projects): renamed parameter projects -> versions
    (configure-orchestration): set up a fake `version' instance and its
    relations according to the new project model
    (configure-distribution): simplified
  • src/commands/command-generate.lisp (command-execute generate):
    instantiate distributions instead of projects
    (generate-deploy): removed projects parameter
  • src/commands/command-report.lisp (command-execute generate):
    instantiate distributions instead of projects
  • changes.sexp (Release 0.25): added enhancement entry

History

#1 Updated by J. Moringen over 5 years ago

  • Status changed from New to In Progress

Btw, looking into this, I noticed that we have lots of different notations for the very same variable, e.g. {kind, build-job.kind} or {build-job.name, build-job-name}.
It would be nice, to state which ones are actually used and which ones are deprecated...

I have a branch that cleans this up, but I couldn't make it work in an entirely backward-compatible way, so I refrained.

#2 Updated by J. Moringen over 5 years ago

  • Target version set to 0.25
  • % Done changed from 0 to 80

#3 Updated by J. Moringen over 5 years ago

  • Category set to Data Model

#4 Updated by J. Moringen over 5 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 80 to 100

Also available in: Atom PDF