Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate whether it's possible to use git fetch for GitLab. #3

Open
tboby opened this issue Dec 2, 2019 · 1 comment
Open

Investigate whether it's possible to use git fetch for GitLab. #3

tboby opened this issue Dec 2, 2019 · 1 comment

Comments

@tboby
Copy link
Member

tboby commented Dec 2, 2019

Currently using GIT_STRATEGY: fetch (the default) results in cwtools-action failing on GitLab. This is because reviewdog needs both the source and target branches of the merge request to be present for the git diff it does.

Git clone seems to solve this, and is more reliable. However, for large mods it can be quite slow to clone even just the last 50 commits, so it would be preferable to use git fetch.

This issue tracks any progress towards that. Please emote if this is something that affects you!

@hiddengearz
Copy link

Maybe you can do the fetch yourself outside of git strategy? I never used it in my script. Also if you're fortunate to use the same public runner (or host one yourself like i do) the container will still have your mods files thus not having to do a full clone.

My gitlab CI is the following:

  - StandardsTest
  - StylingTest
  - FixStyling
  
  
CodingStandards:
  stage: StandardsTest
  image: python:3.6
  only:
    - merge_requests
  script:
    - pip install requests
    - python3 tools/coding_standards.py $Bot_Token

Styling:
  stage: StylingTest
  image: python:3.6
  only:
    - merge_requests
  script:
    - pip install requests
    - python3 tools/check_basic_style_2.py $Bot_Token

FixingStyling:
  stage: FixStyling
  image: python:3.6
  only:
    - merge_requests
  script:
    - pip install requests
    - python3 tools/fix_styling.py $Bot_Token
  after_script:
    - git config --global user.email "an email adress"
    - git config --global user.name "a user name"
    - git config --global push.default simple
    - git remote set-url origin https://aUserNameIRemoved:[email protected]/Millennium_Dawn/Millennium_Dawn.git
    - git add -A
    - git commit -m 'Fixed Styling for you'
    - git push -u origin HEAD:$CI_COMMIT_REF_NAME
    - python3 tools/check_basic_style.py $Bot_Token
    - python3 tools/check_basic_style_2.py $Bot_Token
    
  when: on_failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants