Skip to content
Snippets Groups Projects
Commit 691f3739 authored by Don Zickus's avatar Don Zickus
Browse files

Export ark infrastructure files

Allow developers to use the ark infrastructure work on upstream
git trees.  This change saves the redhat/ plus supporting files
on top of the 'master' branch.

A developer can then 'git merge ark-infra' to apply this
infrastructure.

"NO_CONFIGCHECKS make dist-configs" to create the configs. And
away they go.

Utilize the daily rawhide_release builds to create this branch.  It
fits with the theme and is quick and easy to do in this job.  Note
I use the 'ark-latest' as the source of the export.  This should
include any environment fixes for the developer.

Tested by copy-n-pasting manual each step in the script to generate
the original ark-infra branch.  The gitlab-ci.yml change should be
intuitive enough to skip testing.

V2: Use git-archive and better sed regexp
parent bf53bab3
No related branches found
No related tags found
Loading
Pipeline #269144945 passed
Pipeline: cki-trusted-contributors

#269144962

    ......@@ -100,6 +100,7 @@ rawhide_release:
    script:
    - git checkout --track origin/master && git describe
    - git checkout --track origin/ark-latest && git describe
    - git checkout --track origin/ark-infra && git describe
    - git checkout --track origin/os-build && git describe
    - export PROJECT_ID="$CI_PROJECT_ID"
    - redhat/scripts/ci/ark-create-release.sh "master" "$CI_PROJECT_ID" || exit_code=$?
    ......@@ -117,6 +118,7 @@ rawhide_release:
    - git push gitlab "$(git describe)"
    - git push gitlab ark/*
    - git push -f gitlab ark-latest
    - git push -f gitlab ark-infra
    retry: 2
    rules:
    - if: '$CI_PIPELINE_SOURCE == "schedule" && $RAWHIDE_RELEASE == "true"'
    ......
    ......@@ -57,6 +57,20 @@ RELEASE=$(git describe)
    git checkout ark-latest
    git reset --hard "$RELEASE"
    # Create ark-infra branch
    git checkout ark-infra
    git reset --hard master
    • Contributor

      I'm wondering: wouldn't it be a whole lot easier for downstream maintainers that want to apply some local changes to this branch if you'd

      • omit this git reset --hard master here
      • add a rm -rf makefile Makefile.rhelver redhat/
      • simply add a git merge master; git commit -m "bulk merge ark-infra as of $(date)" after the git archive... | tar -x stuff a few lines below? There normally shouldn't be any conflicts, unless the one-line change to Makefile leads to one, but that should rarely happen.

      Or am I missing something here? I guess I am...

      Edited by Thorsten Leemhuis
    • The problem with the git merge approach would be if you wanted to get the infra stuff on top of some older mainline tag/commit (e.g. for bisecting). If the branch is just a couple commits on top of master, you can easily rebase/cherry-pick it anywhere you want (modulo merge conflicts). If it had master continually merged into it, then it would be infeasible to rebase it (I think... or the result would be messy because of the merge commits) and if you tried to merge it on top of an old revision, it would pull the whole master with it.

      As a kernel developer, I often use the ARK tree to scratch-build almost-mainline testing kernels (with some patches on top) in Koji, so having a branch that can be easily moved around would be a plus for me.

    • Contributor

      hmm, I'm no git expect, but I think you are right. But that leads to another question in my head: why not create the ark-infra branch once on a relative old tag (say 5.4), omit the git merge master and just use the git commit -m "bulk merge ark-infra as of $(date)" after the git archive... | tar -x stuff? Shouldn't it be possible to easily merge this branch ontop of every Linux kernel branch that is newer than 5.4?

      But as I said, I'm not a git expert, so I guess I'm yet again missing something.

    • Author Maintainer

      Hi @knurd42

      Let me take this piece by piece.

      The 'git reset --hard master' was me thinking 'start from scratch' as opposed to use existing 'ark-infra' and build on top. That was an 'oops' on my part and I can certainly incorporate your thoughts there.

      And yes, starting with say an older 5.4 branch, your idea makes sense as there should be almost no merge conflicts (except for the occasional Makefile piece from 'sed', which should be very rare). And I am happy to start the branch that way and just add on top the occasional updates from redhat/.

      Let me update my commit with the suggestions and then rebuild ark-infra on top of 5.4.

      Thanks for the feedback!

    • Author Maintainer

      force pushed an update and rebased ark-infra to 5.4. Let me know if this works for your envisioned workflow!

    • Please register or sign in to reply
    # Using ark-latest because it has latest fixes
    git archive --format=tar ark-latest makefile Makefile.rhelver redhat/ | tar -x
    # Manually add hook instead of cherry-pick
    # Add to middle to avoid git merge conflicts
    sed -i '/# We are using a recursive / i include Makefile.rhelver\n' Makefile
    git add makefile Makefile.rhelver Makefile redhat
    git commit -m 'ARK infrastructure files'
    printf "All done!
    To push all the release artifacts, run:
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment