Skip to content
Snippets Groups Projects
  1. Jul 23, 2020
    • Emanuele Aina's avatar
      tests: Test the ci-package-builder pipeline · b774f652
      Emanuele Aina authored
      
      Set up a test repository and run the ci-package-builder pipeline on it
      by committing new changes, creating merge requests and monitoring the
      resulting pipelines.
      
      The test currently checks:
      * submitting non-release changes and landing them
      * submitting release commits and landing them
      * blocking commits to frozen stable branches
      
      This pipeline needs some extra setup:
      * a tests/dash> repository, forked from pkg/target/dash>, where we
        force-push changes, create merge requests and monitor pipelines
      * the `GITLAB_CI_USER`, `GITLAB_CI_PASSWORD`, `OSC_USERNAME` and
        `OSC_PASSWORD` CI variables to be set on tests/dash>, matching what it
        is used on the pkg/ projects
      * the `TEST_GITLAB_AUTH_TOKEN` CI variable to be set on this repository
        to access the GitLab APIs used to issue MRs and monitor pipelines, and
        to push changes via git to the tests/dash> repository
      * the `TEST_OSCRC` CI variable to be set on this repository to prepare
        the branch projects where the upload jobs will be tested
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      b774f652
  2. Jul 22, 2020
    • Emanuele Aina's avatar
      ci-package-builder: Add $OBS_PREFIX to use home branches · 8532d3cf
      Emanuele Aina authored
      
      Introduce the `$OBS_PREFIX` variable to upload to alternative OBS
      projects from the pipeline.
      
      This is useful when forking a packaging project as uploads can then be
      directed to a user home project branched from one of the main Apertis
      projects, like `home:em:branches:apertis:v2021dev3:target`: set the
      `OBS_PREFIX` variable to `home:em:branches:` in the project's CI/CD
      settings panel and the pipeline will pick it up.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      8532d3cf
    • Emanuele Aina's avatar
      ci-package-builder: Derive the OBS project from the branch name · 7d361dd0
      Emanuele Aina authored
      
      Rather than hardcoding `apertis` as the first part of the OBS project
      names, derive it from the branch name.
      
      For instance, packages built on the `apertis/v2020-security` branch will
      get uploaded to `apertis:v2020:security:$COMPONENT'.
      
      This simplifies customization by product teams since the upload
      destination is now implied by the name of the branches on which they
      have enabled the upload jobs.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      7d361dd0
  3. Jul 17, 2020
  4. Jul 16, 2020
  5. Jul 14, 2020
  6. Jun 29, 2020
  7. Jun 22, 2020
  8. Jun 12, 2020
  9. Jun 11, 2020
  10. May 27, 2020
  11. May 26, 2020
  12. May 23, 2020
    • Emanuele Aina's avatar
      ci-package-builder: Monitor build results from OBS · 87ef0c7c
      Emanuele Aina authored
      
      Stream the build log and propagate the build results from OBS, so that
      developers get integrated feeback directly on their GitLab pipeline.
      
      The approach chosen has the drawback of keeping a full worker slot busy
      doing almost nothing, simply streaming the log from OBS and propagating
      the result.
      
      Builds for larger packages can take more than 7h, and it is not
      acceptable to keep a normal runner slot busy for that.
      
      The best way to handle such issue is to deploy a separate runner that
      only runs these monitoring jobs using the appropriate tags.
      Since each job only consumes a negligible amount of resources a large
      amount of slots can be configured, in a way that long builds do not
      block other jobs.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      87ef0c7c
  13. May 18, 2020
  14. May 01, 2020
  15. Apr 29, 2020
  16. Apr 28, 2020
    • Emanuele Aina's avatar
      ci-package-builder: Skip non-release commits on tag-release · e7f87bd0
      Emanuele Aina authored
      
      The `tag-release` got confused when adding a commit that was not
      changing `debian/changelog` and then manually triggering a pipeline.
      
      Triggering a pipeline manually means that `only: changes:` is ignored,
      so `tag-release` is run: since we're not exactly on a tagged commit
      the job will try to create a new tag only to discover that the tag
      already exists, pointing to previous commit.
      
      To avoid that, rework the job to:
      
      1. skip on UNRELEASED as it did before
      2. fail on PLEASE SUMMARIZE as it did before
      3. fetch a pre-made build if we're sitting on a tagged commit and return
      4. if the changelog points to an existing tag, skip
      5. run the actual build and tag if none of the previous checks matched
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      e7f87bd0
  17. Apr 27, 2020
  18. Apr 23, 2020
    • Emanuele Aina's avatar
      ci-package-builder: Fix snapshot upload · 1f7b57a3
      Emanuele Aina authored
      
      Commit 31726673 "Automatically tag and upload if the changelog does
      not say UNRELEASED" broke non-release uploads since the merged upload
      job only sourced artifacts from the `tag-release` job.
      
      To fix that, add the `build-source` in the `dependencies:` with
      `tag-release` and disambiguate the `_build` directories from the two
      stages to avoid confusing `ci-obs-upload` by having two `.dsc` files.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      1f7b57a3
  19. Apr 12, 2020
    • Emanuele Aina's avatar
      Automatically tag and upload if the changelog does not say UNRELEASED · 31726673
      Emanuele Aina authored
      Currently the pipeline builds and uploads sources to the :snapshots
      OBS project, and then the tagging and upload to the actual OBS
      project needs to be triggered manually by the developer.
      
      Now that things seem to work quite reliably we can let the pipeline
      do the tag and final upload step on its own unless the top entry
      in the `debian/changelog` file has `UNRELEASED` as the target
      distribution.
      
      Before this change, `tally-revision` skipped snapshot uploads for
      already-tagged versions.
      This was to avoid submitting everything to snapshots when creating
      branches while branching a release.
      Since the other steps were manual, they just were left pending.
      
      Now that we have a single upload stage we can't use `tally-revision`
      without breaking fast-forward backports, where e.g. version 0.1co1 gets
      landed to v2021dev2 and then we want to propagate it unchanged to v2020.
      From the pipeline perspective, there's no way to distinguish that case
      (where we want to upload) from the case where we branch v2021dev3 from
      v2021dev2 (where we want to skip uploading).
      
      In this version what happens when branching is that:
      1. stage build get skipped
      1. stage release runs, and simply checks out the sources with
         pristine-lfs
      1. stage uploads tries to re-upload to OBS what OBS already has with
         `osc dput`, which will likely return an error, marking the pipeline
         failed
      
      This means that we'd do a bit more useless work during branching
      compared to now, but not too much.
      
      Ideally branch creation should skip ci, but there's no option in the
      API to do so (we use the API to avoid checking out every single
      repository):
      https://gitlab.com/gitlab-org/gitlab/-/issues/26422#note_314606108
      
      
      
      To avoid the failed pipelines we may enhance `ci-obs-upload` in a
      followup MR to return success when the upload is a no-op.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      31726673
  20. Apr 10, 2020
  21. Apr 09, 2020
  22. Mar 25, 2020
  23. Mar 23, 2020
  24. Mar 13, 2020
    • Emanuele Aina's avatar
      ci-package-builder: · dfb94638
      Emanuele Aina authored
      
      Commit bd9e1697 "Automatically freeze stable branches" uses the
      wrong YAML multiline syntax and since it trims newlines it produces an
      invalid shell snippet, breaking merge pipelines with this error:
      
          $ if echo $CI_MERGE_REQUEST_TARGET_BRANCH_NAME | grep -Ev '(dev[0-9]|pre)$' then # collapsed multi-line command
          /bin/bash: eval: line 124: syntax error near unexpected token `fi'
      
      Switch from `>` to `|` to preserve newlines in the snippet.
      
      Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
      dfb94638
Loading