X Tutup
Skip to content

[CI] move drone config to starlark and .yml format#237

Merged
phil-davis merged 2 commits intomasterfrom
move-to-starlark
Feb 4, 2021
Merged

[CI] move drone config to starlark and .yml format#237
phil-davis merged 2 commits intomasterfrom
move-to-starlark

Conversation

@dpakach
Copy link
Contributor

@dpakach dpakach commented Feb 2, 2021

move ci config to .drone.starlark + .drone.yml

@mmattel mmattel requested a review from phil-davis February 2, 2021 09:40
@dpakach
Copy link
Contributor Author

dpakach commented Feb 2, 2021

the acceptance test pipelines are not running with this config format. The result should have been identified as drone generates .yml file from the .star file in runtime but something is different when I generate the .drone.yml file locally.
@phil-davis do you have any idea about this?

@phil-davis
Copy link
Contributor

https://drone.owncloud.com/owncloud/encryption/1668 CI from a normal PR ran lots of acceptance tests a few days ago.
I will think about what could be wrong.

@phil-davis
Copy link
Contributor

This will be related to the use of ctx.build.event in .drone.starlark. When we locally run:

drone starlark --source .drone.starlark

then it does not know what the the build event is.

I will think what the logic should be for running locally to generate the yml

@phil-davis
Copy link
Contributor

And the locally-generated YML ends up with stuff like:

- name: sync-from-cache
  pull: always
  image: minio/mc:RELEASE.2020-12-18T10-53-53Z
  commands:
  - mkdir -p results
  - mc mirror cache/cache//-${DRONE_BUILD_NUMBER} results/
  environment:
    MC_HOST_cache:
      from_secret: cache_s3_connection_url

The local starlark of course has no idea about ctx.repo.slug or ctx.build.commit or ${DRONE_BUILD_NUMBER} - those are all variable at the run-time of the drone build.

@mmattel
Copy link
Contributor

mmattel commented Feb 2, 2021

All is green but not sonarcloud, seems it is not happy...

ERROR: Error during SonarScanner execution
--
49 | ERROR: Parameter 'sonar.pullrequest.branch' is mandatory for a pull request analysis
50 | ERROR:
51 | ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the cache for the unit test coverage ends up in a folder like cache/cache/encryption/1aca2a32c81002fdcc78d538fe924d567940ea79-1691

It used to be like https://drone.owncloud.com/owncloud/encryption/1668/14/5 cache/cache/owncloud/encryption/bb82610f5118d451d03640fdd2b5eafb21e12c95-1668

(It had an extra owncloud in the path)

But really that does not matter. The results get purged after being used for SonarCloud analysis.

@phil-davis phil-davis merged commit edd23f5 into master Feb 4, 2021
@delete-merged-branch delete-merged-branch bot deleted the move-to-starlark branch February 4, 2021 03:34
@phil-davis
Copy link
Contributor

The merge CI is drone job https://drone.owncloud.com/owncloud/encryption/1692
It is running a full set of unit tests, SonarCloud analysis and acceptance tests.
Previously the merge CI would only run the unit tests and SonarCloud analysis: https://drone.owncloud.com/owncloud/encryption/1663

That is OK for now. It might be rather challenging to run the acceptance tests just on pull-request and nightly, but not on the merge CI.

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.

3 participants

X Tutup