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

ci: enhance pull_request workflow #557

Merged
merged 13 commits into from
Jul 17, 2024

Conversation

Abhinandan-Purkait
Copy link
Member

Workflow in detail

  1. A user creates a PR to develop or release/x.y branch.
  2. The concerned GitHub action workflow kicks in on the PR.
  3. First, it checks out and sets up the runner.
  4. It then runs the lint. Shellcheck and helm lint.
  5. Verify the chart version, it should be of the format x.y+1.0-develop. If it’s anything else, the workflow fails. From now on any change to the helm chart in the PR would not need a helm version change. Users are not supposed to change the chart version in their PRs, even if it’s a helm change.
  6. Extract the chart version from the chart. This tag would be used for building the image locally.
  7. Build the images using the code in the branch and tag it with x.y+1.0-develop
  8. Set up the minikube cluster.
  9. Execute the CI tests by installing the helm chart from the deploy/helm/charts directory. Set the image pull policy to Never since we are supposed to use the images built in the previous step.
  10. Execute the CI tests. We are to use the helm chart here.
  11. If the test passes the CI succeeds else it fails.

@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.53%. Comparing base (1c29ecd) to head (c627be5).
Report is 1 commits behind head on develop.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #557   +/-   ##
========================================
  Coverage    99.53%   99.53%           
========================================
  Files            1        1           
  Lines          431      431           
========================================
  Hits           429      429           
  Misses           1        1           
  Partials         1        1           
Flag Coverage Δ
bddtests 99.53% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Show resolved Hide resolved
scripts/shell.nix Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
scripts/shell.nix Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
Copy link

@pchandra19 pchandra19 left a comment

Choose a reason for hiding this comment

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

Verify the chart version, it should be of the format x.y+1.0-develop. If it’s anything else, the workflow fails. From now on any change to the helm chart in the PR would not need a helm version change. Users are not supposed to change the chart version in their PRs, even if it’s a helm change.

Just a few question on above : You mentioned the format should be "x.y+1.0-develop"
a) That means we will not be releasing any patch versions ?
b) Why do we have to even increment y (y+1) ?

@Abhinandan-Purkait
Copy link
Member Author

Just a few question on above : You mentioned the format should be "x.y+1.0-develop"
a) That means we will not be releasing any patch versions ?

Yes we would be releasing patch versions.

b) Why do we have to even increment y (y+1) ?

Once a release is made, develop becomes the vNext. The patch releases are done from release/x.y branches. Now whenever a release let's say x.y.z is made, the develop would now become x.y+1-develop because we are working towards bumping the minor version and the release/x.y becomes x.y.z+1-prerelease because in release/x.y we are working towards bumping a patch version.

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
scripts/validate-version.sh Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
deploy/helm/charts/values.yaml Outdated Show resolved Hide resolved
scripts/nix/sources.json Outdated Show resolved Hide resolved
scripts/shell.nix Outdated Show resolved Hide resolved
scripts/validate-version.sh Outdated Show resolved Hide resolved
tests/tests.test Outdated Show resolved Hide resolved
@Abhinandan-Purkait Abhinandan-Purkait force-pushed the pr_workflow branch 2 times, most recently from e2593dd to d25fa76 Compare July 16, 2024 11:41
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
ci/ci-test.sh Outdated Show resolved Hide resolved
scripts/nix/sources.json Outdated Show resolved Hide resolved
Copy link
Member

@niladrih niladrih left a comment

Choose a reason for hiding this comment

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

The chart-release workflow might run as soon as this PR is merged, due to the helm chart change. We might want to disable that workflow. Temporarily removing the on YAML body (with a comment) could be enough.

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
@Abhinandan-Purkait
Copy link
Member Author

The chart-release workflow might run as soon as this PR is merged, due to the helm chart change. We might want to disable that workflow. Temporarily removing the on YAML body (with a comment) could be enough.

Done. Also wondering would it be a good idea to disable the build.yml workflow.

@niladrih
Copy link
Member

The chart-release workflow might run as soon as this PR is merged, due to the helm chart change. We might want to disable that workflow. Temporarily removing the on YAML body (with a comment) could be enough.

Done. Also wondering would it be a good idea to disable the build.yml workflow.

IMO we should let the build workflow run because there's WIP PRs and contributions coming in and contributors might want to work with their built develop branch images.

Makefile Outdated Show resolved Hide resolved
Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
@Abhinandan-Purkait Abhinandan-Purkait merged commit c45ef19 into openebs:develop Jul 17, 2024
7 checks passed
@Abhinandan-Purkait Abhinandan-Purkait deleted the pr_workflow branch July 26, 2024 12:26
Abhinandan-Purkait added a commit that referenced this pull request Sep 10, 2024
* ci: enhance pull_request workflow

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: use ct via nix-shell,

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add the csi-driver step

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: the release regex

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: remove test.test binary

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add gitignore entry for .test files

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: remove redundant die method

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: set analytics to be disabled on ci

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: shebang, condition check, script input

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: move zfs env setup inside nix

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: get IMAGE_TAG from chart

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* ci: disable the chart releaser workflow temporarily

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: don't use yq for extracting version in Makefile

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

---------

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Abhinandan-Purkait added a commit that referenced this pull request Sep 10, 2024
* ci: enhance pull_request workflow (#557)

* ci: enhance pull_request workflow

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: use ct via nix-shell,

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add the csi-driver step

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: the release regex

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: remove test.test binary

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add gitignore entry for .test files

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: remove redundant die method

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: set analytics to be disabled on ci

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* fix: shebang, condition check, script input

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: move zfs env setup inside nix

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: get IMAGE_TAG from chart

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* ci: disable the chart releaser workflow temporarily

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: don't use yq for extracting version in Makefile

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

---------

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: replace CRD with auto-generated copy (#564)

Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>

* ci: enhance build.yml workflow

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* ci: add branch preparation and release CI changes (#567)

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: cleanup unused scripts, update make manifests (#569)

* chore: cleanup unused scripts, update make manifets

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: generate operator from helm template

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* ci: add manifests and codegen validation in pull request

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: add comments on the generate-manifests script

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: generate zfs-operator by disabling helm labels

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

---------

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

* chore: set version to prerelease

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>

---------

Signed-off-by: Abhinandan Purkait <purkaitabhinandan@gmail.com>
Signed-off-by: Niladri Halder <niladri.halder26@gmail.com>
Co-authored-by: Niladri Halder <niladri.halder26@gmail.com>
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.

6 participants