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

tools: Migrate from CircleCi to GitHub Actions #679

Merged

Conversation

shahzadlone
Copy link
Member

@shahzadlone shahzadlone commented Jul 27, 2022

Relevant issue(s)

Resolves #570

Description

  • Moves all our CircleCi workflows to GitHub Actions (Change Detection, Test Runs).
  • Change detection will only run in [PRs] or [pushes to tags, master, or develop].
  • Change detection for GitHub Action Workflow needed explicit private and public ssh keys (generated and added the corresponding keys to secret section, and deploy key sections), there is an authentication step that takes care of the SSH authentication for that workflow.
  • Added a new Workflow to build defradb binary and call defradb start on it to ensure the start up command doesn't crash.
  • Removed CircleCi config file validation tool.

Merge Process

In order for a clean merge, once we decide we are ready to merge this will need to disable CircleCi completely so the failing CI check doesn't show up. In that amount of time would strongly suggest no other merges happen (since we are in code freeze anyways it should be less of an issue).

Pre-Merge Steps:

  • Remove required CI checks from CircleCi
  • Stop CircleCi from building this repository.
  • Merge once all checks pass.

Post-Merge Steps:

  • Add / Update required CI checks with all Github Actions that run on pushes to develop, maybe for master too (in branch protection rules).
  • Remove the CircleCi Deploy key (was gone already, perhaps circleci removed it?).

Limitations

Through this change found that CircleCi was actually not properly setting these environment variables:

      DEFRA_BADGER_MEMORY: true
      DEFRA_BADGER_FILE: true
      DEFRA_MAP: true

So for now the CI will run without them and have made these issues:

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

  • This PR's checks should show if these workflows work or not.

Specify the platform(s) on which this was tested:

  • Manjaro

@shahzadlone shahzadlone added the ci/build This is issue is about the build or CI system, and the administration of it. label Jul 27, 2022
@shahzadlone shahzadlone self-assigned this Jul 27, 2022
@source-devs

This comment was marked as off-topic.

@shahzadlone shahzadlone added the action/no-benchmark Skips the action that runs the benchmark. label Jul 27, 2022
@sourcenetwork sourcenetwork deleted a comment from source-devs Jul 27, 2022
@shahzadlone shahzadlone force-pushed the lone/tools/migrate-all-circli-pipelines-to-github-actions branch from ce440ab to 2fe3e2f Compare July 27, 2022 08:26
@orpheuslummis
Copy link
Contributor

It LGTM so I'm not sure why it fails. Any insight?

@shahzadlone
Copy link
Member Author

shahzadlone commented Jul 27, 2022

It LGTM so I'm not sure why it fails. Any insight?

Have a few hunches, but nothing certain. Will let you know when I fix it and convert to non-draft.

Here are the finding @orpheuslummis :

  1. Running Tests Workflow was failing because of:
  1. Change Detection was failing because GitHub Action SSH Authentication was needed.

@shahzadlone shahzadlone force-pushed the lone/tools/migrate-all-circli-pipelines-to-github-actions branch 18 times, most recently from 683d5a0 to 575aa6a Compare July 28, 2022 09:04
@shahzadlone shahzadlone changed the title tools: Migrate fully from CircleCi to GitHub Actions tools: Migrate from CircleCi to GitHub Actions Jul 28, 2022
@shahzadlone shahzadlone force-pushed the lone/tools/migrate-all-circli-pipelines-to-github-actions branch from 575aa6a to a39b49b Compare July 28, 2022 09:39
@shahzadlone shahzadlone marked this pull request as ready for review July 28, 2022 09:46
@shahzadlone shahzadlone added the area/testing Related to any test or testing suite label Jul 28, 2022
Copy link
Collaborator

@fredcarle fredcarle left a comment

Choose a reason for hiding this comment

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

LGTM but I do have one question/concern before you merge.

Comment on lines 165 to +167
.PHONY: test\:changes
test\:changes:
env DEFRA_DETECT_DATABASE_CHANGES=true gotestsum --junitfile /tmp/defradb-dev/changes.xml -- ./... -shuffle=on -p 1
env DEFRA_DETECT_DATABASE_CHANGES=true gotestsum -- ./... -shuffle=on -p 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Trying to run this will fail because of the issue we raised yesterday. Should be remove it for now?

Copy link
Member Author

@shahzadlone shahzadlone Jul 28, 2022

Choose a reason for hiding this comment

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

No this will not fail. Infact we have an entire GitHub Action that is running this and passing (Detect Change).

We had two problems yesterday:

  1. SSH authentication was not being done, i.e. the git command would fail. (solved by adding private and public ssh secrets and deployment key and doing the authentication in the runner).

  2. Setting this env variable to false was still running the detection tests (solved by not setting this env to false explicitly anymore).

Moreover, we do have an other off case (issue #637) where with race this always fails (but rarely should this fail without race).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah dam... Missed the SSH auth part in the PR description. Sorry about that. If the keys are there then all good 🙂

@shahzadlone shahzadlone force-pushed the lone/tools/migrate-all-circli-pipelines-to-github-actions branch from a39b49b to 702ff82 Compare July 28, 2022 21:21
Copy link
Contributor

@orpheuslummis orpheuslummis left a comment

Choose a reason for hiding this comment

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

LGTM

.github/workflows/start-binary.yml Show resolved Hide resolved
@shahzadlone
Copy link
Member Author

Since we are in "code freeze" and this seems to be not v0.3.0 specific, we can hold this off until develop is ready for v0.3.1.

@shahzadlone shahzadlone force-pushed the lone/tools/migrate-all-circli-pipelines-to-github-actions branch from 702ff82 to 9e52dc8 Compare August 3, 2022 05:33
@shahzadlone shahzadlone merged commit 3973c2d into develop Aug 3, 2022
@shahzadlone shahzadlone deleted the lone/tools/migrate-all-circli-pipelines-to-github-actions branch August 3, 2022 05:49
shahzadlone added a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
- Resolves sourcenetwork#570 

- Description:
	* Moves all our CircleCi workflows to GitHub Actions (Change Detection, Test Runs).
	* Change detection will only run in [PRs] or [pushes to tags, master, or develop].
	* Change detection for GitHub Action Workflow needed explicit private and public ssh keys (generated and added the corresponding keys to secret section, and deploy key sections), there is an authentication step that takes care of the SSH authentication for that workflow.
	* Added a new Workflow to build defradb binary and call `defradb start` on it to ensure the start up command doesn't crash.
	* Removed CircleCi config file validation tool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/testing Related to any test or testing suite ci/build This is issue is about the build or CI system, and the administration of it. DO NOT MERGE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace CircleCI by Github Actions
4 participants