Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-71154

Make CI tools (Travis and GHA) to avoid building upstream branches

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.5.17, 3.8.8, 3.9.5, 3.10.2, 3.11, 4.0
    • Fix Version/s: 3.9.7, 3.10.4
    • Component/s: General, Unit tests
    • Labels:
    • Testing Instructions:
      Hide

      It should be enough to test this with just one of the upstream branches (pick one from 39_STABLE to master). Let's call it the "BRANCH".

      Requirement: Better tested by some developer that has a github clone.

      Upstream branches are not built.

      1. Checkout the BRANCH.
      2. Perform any modification to some file (say adding a comment or whatever).
      3. Commit the changes.
      4. Push the BRANCH to github.
      5. Verify that neither GHA or Travis start any build of the BRANCH.

      Other branches are built.

      1. Create a new branch, named MDL-works (for example), branching from the BRANCH.
      2. Push the new branch (MDL-works) to github.
      3. Verify that both GHA and Travis start a build of the new branch (MDL-works).

      Normal tags are not built

      1. Create a tag named "v3.12.0" (for example) for the MDL-works branch.
      2. Push it to github.
      3. Verify that neither GHA or Travis start any build of the tag.

      Other tags still are built:

      1. Create a tag named "rare_tag" (for example) for the MDL-works branch.
      2. Push it to github.
      3. Verify that both GHA and Travis start a build of the new tag (rare_tag).

      Cleanup

      1. Don't forget to cleanup all the stuff used in this issue:
        1. Reset hard the BRANCH to its origin counterpart.
        2. Delete the MDL-works branch (local and github)
        3. Delete the v3.12.0 tag (local and github)
        4. Delete the rare_tag (local and github)
      Show
      It should be enough to test this with just one of the upstream branches (pick one from 39_STABLE to master). Let's call it the "BRANCH". Requirement: Better tested by some developer that has a github clone. Upstream branches are not built. Checkout the BRANCH. Perform any modification to some file (say adding a comment or whatever). Commit the changes. Push the BRANCH to github. Verify that neither GHA or Travis start any build of the BRANCH. Other branches are built. Create a new branch, named MDL-works (for example), branching from the BRANCH. Push the new branch (MDL-works) to github. Verify that both GHA and Travis start a build of the new branch (MDL-works). Normal tags are not built Create a tag named "v3.12.0" (for example) for the MDL-works branch. Push it to github. Verify that neither GHA or Travis start any build of the tag. Other tags still are built: Create a tag named "rare_tag" (for example) for the MDL-works branch. Push it to github. Verify that both GHA and Travis start a build of the new tag (rare_tag). Cleanup Don't forget to cleanup all the stuff used in this issue: Reset hard the BRANCH to its origin counterpart. Delete the MDL-works branch (local and github) Delete the v3.12.0 tag (local and github) Delete the rare_tag (local and github)
    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE, MOODLE_400_STABLE
    • Fixed Branches:
      MOODLE_310_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
    • Pull 3.10 Branch:
      MDL-71154_310
    • Pull 3.11 Branch:
      MDL-71154_311
    • Pull Master Branch:

      Description

      Right now, every time a moodle/moodle clone is pushed to github, it triggers any CI automation configured, normally Travis and/or GHA.

      That's a lot of jobs for nothing, repeated everywhere (really those CI tools should be cleverer and detect when the same job is being run multiple times, but they don't).

      Also because upstream branches are already checked by Moodle own Ci infrastructure (phpunit, behat, cibot...).

      So this issue is about:

      1) by default, prevent master and stable upstream branches to trigger Travis or GHA jobs.
      2) if possible (opt-in) allow them to be run via environment variable.

      Ciao

        Attachments

        1. 311_mdl_identical.png
          311_mdl_identical.png
          26 kB
        2. gha_no_upstream.png
          gha_no_upstream.png
          114 kB
        3. gha_upstream_no_build.png
          gha_upstream_no_build.png
          9 kB
        4. gha_working.png
          gha_working.png
          79 kB
        5. master_mdl_identical.png
          master_mdl_identical.png
          24 kB
        6. Normal tags are not built.png
          Normal tags are not built.png
          785 kB
        7. Other branches are built.png
          Other branches are built.png
          796 kB
        8. Other tags still are built.png
          Other tags still are built.png
          614 kB
        9. tagged.png
          tagged.png
          34 kB
        10. travis_no_upstream.png
          travis_no_upstream.png
          197 kB
        11. travis_upstream_no_build.png
          travis_upstream_no_build.png
          27 kB
        12. travis_working.png
          travis_working.png
          98 kB
        13. Upstream branches are not built.png
          Upstream branches are not built.png
          835 kB

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Tim Hunt Tim Hunt
            Integrator:
            Andrew Lyons Andrew Lyons
            Tester:
            Huong Nguyen Huong Nguyen
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              10/May/21

                Time Tracking

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Time Spent - 4 hours, 5 minutes Remaining Estimate - 1 day, 7 hours, 15 minutes
                1d 7h 15m
                Logged:
                Time Spent - 4 hours, 5 minutes Remaining Estimate - 1 day, 7 hours, 15 minutes
                4h 5m