Shippable / support

Shippable SaaS customers can report issues and feature requests in this repository
101 stars 28 forks source link

Cache and shippable.yml #5027

Open mei-li opened 4 years ago

mei-li commented 4 years ago

Description of your issue:

We have made some changes in shippable.yml. We have branches that include these changes and ones that do not. I can see from the build that some Pull requests and commits take into account the shippable.yml changes. Though in some branches/ Pull requests, while the changes are in shippable.yml after some commit, the build tries to use the old yml that refers to an unexistent file. We had this issue in the past many times as well. Rerun does not help. If I remember correctly in the past we used a workaround of making a new branch.

I suspect that these 2 branches were pushed and build initially before the changes in yml took place, then the changes were pulled in the branch, but the shippable.yml is somehow cached. Is that what happens? Is it expected behavior?

shippable.yml structure

    language: python

python:
    - 3.7.3
env:
    - secure: .....

build:
    pre_ci_boot:
        image_name: ...
        image_tag: ...
        pull: true
    cache: true
    cache_dir_list:
        - $SHIPPABLE_BUILD_DIR/node_modules
    ci:
        # set locale
        - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y locales
       # more commands
a-murphy commented 4 years ago

GitHub pull request builds will normally run with the result of merging any changes to the YML in the pull request with the YML in the base branch, but Bitbucket pull requests should run using the YML of the base branch. Commit builds should run with the YML from the commit in both cases.

mei-li commented 4 years ago

I think I did not describe the problem well. old.yml used a file shippable_check_integration_tests new.yml does not use it

The flow of events is the following

  1. PR created with new.yml all tests passed
  2. Branch created-before-the-merge-of-new-yml
  3. Branch tests are passing with old.yml
  4. PR with new.yml is merged in master
  5. Branch created-before-the-merge-of-new-yml merges master in the branch.

At this point both master and created-before-the-merge-of-new-yml have new.yml.

Issue: Tests in created-before-the-merge-of-new-yml use theold.yml Expected result: Tests in created-before-the-merge-of-new-yml should use the new.yml that in in the branch code

a-murphy commented 4 years ago

It could be because the linked build was a rerun. If the rerun was rerunning something that ran before master was updated with the new YML, it could be running commands that are no longer in the YML. (It's also possible to rerun runs using the same commit in the base branch, but that is optional.) However, the pull request should have also triggered new runs, using the new YML, when the pull request was updated by the update to the created-before-the-merge-of-new-yml branch. And future webhook triggers should also trigger runs with the new YML.