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

feat(CI): Add Travis CI support #170

Closed
wants to merge 4 commits into from
Closed

Conversation

nickboldt
Copy link
Contributor

@nickboldt nickboldt commented Jul 5, 2021

replaces #162

relates to eclipse-che/che#19688

@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #170 (8b1554e) into main (4dd4695) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #170   +/-   ##
=======================================
  Coverage   45.18%   45.18%           
=======================================
  Files          13       13           
  Lines         509      509           
=======================================
  Hits          230      230           
  Misses        276      276           
  Partials        3        3           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4dd4695...8b1554e. Read the comment docs.

@nickboldt
Copy link
Contributor Author

Note: this is not yet running in travis due to "Could not authorize build request" - see https://travis-ci.com/github/eclipse-che/che-machine-exec/requests?requestId=577440508

@svghadi
Copy link

svghadi commented Jul 7, 2021

Hi @nickboldt, looks like the job is not getting triggered due to token issue.

https://github.com/eclipse-che/che-machine-exec/pull/170/checks?check_run_id=2992405237

{
  "@type": "error",
  "error_type": "wrong_credentials",
  "error_message": "access denied"
}

Is secrets.TRAVIS_TOKEN variable set in Github Action?

@nickboldt
Copy link
Contributor Author

Is secrets.TRAVIS_TOKEN variable set in Github Action?

2 questions:

        curl -s -X POST \
        -H "Content-Type: application/json" \
        -H "Accept: application/json" \
        -H "Travis-API-Version: 3" \
        -H "Authorization: token ${{ secrets.TRAVIS_TOKEN }}" \
        -d "$body" \
        https://api.travis-ci.com/repo/eclipse-che%2Fche-machine-exec/requests

@svghadi
Copy link

svghadi commented Jul 8, 2021

what value shoud be in that token? can I generate one from https://travis-ci.com/github/eclipse-che/che-machine-exec/settings somewhere?

Api token can be found under account preferences ( https://travis-ci.com/account/preferences )

api-token

which action should be running the travis builds? is it in gh_actions_pr.yaml?

Yes. Travis build for PR check is triggered through gh_actions_pr.yaml and this will handle docker build as well as unit tests. For next build and release, next-build.yaml & release.yml files will trigger travis builds respectively.

@nickboldt
Copy link
Contributor Author

I uploaded my exported token from https://travis-ci.com/account/preferences, then uploaded it as a secret called TRAVIS_TOKEN to eclipse-che/che-machine-exec ... but still failing.

Also tried to re-trigger this PR's action to trigger the travis process...

https://github.com/eclipse-che/che-machine-exec/runs/3019403781?check_suite_focus=true

... but while the action shows succcess... over at https://travis-ci.com/github/eclipse-che/che-machine-exec/requests I'm seeing the same error:

image

@nickboldt
Copy link
Contributor Author

Latest failures "Build config did not create any jobs" appear to be releated to travis-ci/travis-ci#8536

@svghadi
Copy link

svghadi commented Jul 8, 2021

Hi @nickboldt, travis jobs will not be triggered until the jobs present in .travis.yml file are committed into the repo. It's kind of a limitation as we are using api calls to trigger travis jobs.

#162 (comment)

PR check limitation on triggering PR-check jobs on Travis via API:
- The Travis API token will be available to PRs raised by users with write access to that particular repo.
- Changes made to .travis.yml file in PRs will not be validated in PR check Travis jobs until the changes are committed into the repo.

@nickboldt
Copy link
Contributor Author

Uploaded 4 secrets to https://travis-ci.com/github/eclipse-che/che-machine-exec/settings

image

But I see that unlike the PR for theia, this one embeds the secrets directly (and uses different variable names):

image

@prabhav-thali
Copy link
Contributor

Hi @nickboldt,

we had kept only 4 secrets in PR #162 (naming convention was followed as per GH actions secrets)i.e.

DOCKER_PASSWORD
DOCKER_USERNAME
QUAY_PASSWORD
QUAY_USERNAME

Below variables are not required currently as Travis is experimental
GITHUB_TOKEN - as execution of make-release.sh will happen only in GH action as it contains git operations.
MATTERMOST_WEBHOOK_URL - Not implemented in Travis for now.

Signed-off-by: Prabhav Thali <[email protected]>

Adds travis suffix and removes workflows handled on GA

use upstream gh secret names

Change-Id: I34f9126cfe29d2d318f17b37699ade668a02815e
Signed-off-by: nickboldt <[email protected]>

add secrets and let travis CI autoformat script

Change-Id: I622dccb74aa08558e4be715889cc24e25f6b4104
Signed-off-by: nickboldt <[email protected]>

add license headers to new .travis.yml and *.sh scripts

Change-Id: Ibac061ec2adcac0df1feb39618423da0378260ae
Signed-off-by: nickboldt <[email protected]>

no-op change to trigger GH workflow using new TRAVIS_TOKEN

Change-Id: Ife082c3c4da8e32bae444cc64c2efe206c445e9b
Signed-off-by: nickboldt <[email protected]>

Revert "no-op change to trigger GH workflow using new TRAVIS_TOKEN"

This reverts commit 052ba3c.

Revert "Revert "no-op change to trigger GH workflow using new TRAVIS_TOKEN""

This reverts commit 0d7feec.

Revert "Revert "Revert "no-op change to trigger GH workflow using new TRAVIS_TOKEN"""

This reverts commit 83bd477.
@nickboldt nickboldt changed the title Add travis support, but using origin fork and adding in encrypted secrets feat(CI): Add Travis CI support Aug 17, 2021
…using PRs first

Change-Id: Ib8ac14a81d6cec67550d191eab9f37fb02c3dcfb
Signed-off-by: nickboldt <[email protected]>
… SUFFIX); just append -travis on SHORT_SHA variable; don't run shell scripts in a nested bash (just run them as is)

Change-Id: I04dce67f8fafccb3da9cdf411f79cfdcd9a49098
Signed-off-by: nickboldt <[email protected]>
@nickboldt
Copy link
Contributor Author

Travis seems to think that machine-exec is a rake build...

https://travis-ci.com/github/eclipse-che/che-machine-exec/builds/235580715

@benoitf
Copy link
Contributor

benoitf commented Aug 18, 2021

@nickboldt I think it's because there is no .travis.yaml file yet ?

@benoitf
Copy link
Contributor

benoitf commented Aug 18, 2021

the travis output shows that it's trying to execute it in the 'main' branch

@prabhav-thali
Copy link
Contributor

Hi @nickboldt,
In case of PR check, As @Siddhesh-Ghadi has mentioned here about having limitations as we trigger PR check using API. Once changes are merged it will consider travis.yml from main branch and create jobs on Travis CI.

@prabhav-thali
Copy link
Contributor

Changes required in few files:

  • We will have to append one more condition here (AND env(PR_NUMBER) IS blank). Also same needs to be appended on all next build jobs if condition. This helps to restrict jobs only to next build as we are using API to trigger PR check as well.

  • And as suggested here, we need to add eval before this as enclosing AMEND in quotes leads to invalid reference format error. On every docker manifest create command, we will require eval. (Ref: .ci/travis/publish_multiarch.sh in https://github.com/eclipse-che/che-theia/pull/1127/files).

  • Also, While testing we had observed that all the scripts which are used i.e. .travis/build_image.sh and .travis/publish_multiarch.sh are required to be made executable otherwise permission denied error is seen in Travis build.

  • Currently, as we will be executing jobs for PR check only. It will work fine as images wont be pushed. But in case of next and release build jobs, tags will collide with those pushed from GH actions as TRAVIS_TAG is removed in this commit. We might have to add it back or handle "-travis" for next and release build jobs as it was implemented in Che-theia PR.

prabhav-thali added a commit to linux-on-ibm-z/che-machine-exec that referenced this pull request Aug 20, 2021
prabhav-thali added a commit to linux-on-ibm-z/che-machine-exec that referenced this pull request Aug 20, 2021
nickboldt pushed a commit that referenced this pull request Aug 20, 2021
* feat(CI): Adds Travis CI support

Signed-off-by: Prabhav Thali <[email protected]>

* Adds travis suffix and removes workflows handled on GA

* changes to sync with PR #170
@nickboldt
Copy link
Contributor Author

nickboldt commented Aug 20, 2021

I've merged #162, so we can close this

@nickboldt nickboldt closed this Aug 20, 2021
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

Successfully merging this pull request may close these issues.

5 participants