CI/CD Pipeline For Jocaagura Ecosystem On GitHub
Hey guys! Today, we're diving deep into how to set up a standardized CI/CD (Continuous Integration/Continuous Deployment) pipeline for GitHub repositories within the Jocaagura ecosystem. This setup ensures code quality, consistent versioning, and automated validations across all your projects. Let's get started!
Standardized CI/CD pipeline implementation for GitHub repositories in the Jocaagura ecosystem
Description
The primary goal here is to implement a complete CI/CD system in jocaagura ecosystem repositories. This involves ensuring:
- Strict validations on every developer push.
- Automatic versioning (major, minor, patch) on pull requests (PRs) targeting
develop. - Versioning validations on PRs targeting
master. - Coherent and protected branch structure.
- A complete workflow from issue creation to dev branches, rev branches, PRs, and releases.
This system standardizes code quality, versioning traceability, validation automation, and protection of critical branches.
Given
- The jocaagura ecosystem needs a clear, reproducible workflow for all repositories.
- A standard set of branches has been defined:
dev/**,rev/**,develop,master. - Three fundamental workflows need standardization:
validate_commits_and_lints.yamlvalidate_pr.yamlvalidate_pr_master.yaml
- Protection rules must ensure code integrity, consistent versioning, and signed commits.
- Developers require an understandable and consistent workflow across all jocaagura repositories.
When
Workflows and protection rules are implemented according to the described standard, ensuring that:
- Each push to
dev/**branches validates minimum quality. rev/**branches only receive "curated" code.- PRs to
developexecute complete validations and automatically bump the version. - PRs to
masterverify strict version increments. - Main branches are protected.
Then
dev/**branches are automatically validated on each push.rev/**branches act as an integration point per issue without CI.- PRs to
developautomatically update the version and validate complete quality. - PRs to
masterensure correct increments and consistent releases. - The repository has a reproducible, clear CI/CD system aligned with the jocaagura standard.
- Developers have a clear and guided experience for contributing.
Tasks
Let's break down the tasks needed to achieve this awesome CI/CD pipeline.
1. Configuration of Protection Rules
- [ ] Create a ruleset Protect to develop with:
- Direct push blocking
- Signed commits
- 1+ review
- Checks in green
- Code scanning
- [ ] Create a ruleset Protect to master with:
- Rules from develop + strict version validation
- [ ] Create a rule review push for dev/** (future expansion)
- [ ] Validate expected behavior through integration tests.
2. Implement workflow validate_commits_and_lints.yaml
- [ ] Execute on push to branches except:
develop,master,rev/**. - [ ] Validate signed commits.
- [ ] Reject
dependency_overrides. - [ ] Execute static analysis without warnings.
- [ ] Validate
flutter pub getin all packages.
3. Implement workflow validate_pr.yaml (PR → develop)
- [ ] Validate format (
dart format). - [ ] Validate analyzer (
flutter analyze). - [ ] Execute tests (
flutter test). - [ ] Require CHANGELOG update.
- [ ] Obtain label (major/minor/patch).
- [ ] Perform automatic version bump.
- [ ] Sign the generated commit.
- [ ] Perform automatic push to the PR branch.
4. Implement workflow validate_pr_master.yaml (PR → master)
- [ ] Validate format.
- [ ] Validate analyzer.
- [ ] Execute tests.
- [ ] Verify that the version is strictly greater than the existing one.
5. Branch Structure
- [ ] Document usage of:
master(releases)develop(functional integration)rev/<issue>(integration per issue)dev/<issue>-<devname>(individual work)
- [ ] Integrate this structure into the repos as standard.
6. Documentation of the Complete Flow
- [ ] Describe steps 1–8 of the CI/CD flow.
- [ ] Include official diagram of the flow.
- [ ] Include checklist for implementers.
- [ ] Create a guide for new repositories.
Validations
To ensure everything is working as expected, we need to validate the following:
- A push to
dev/<issue>-<dev>correctly activatesvalidate_commits_and_lintsand fails if:- There are
dependency overrides. - There is no signature.
- There are warnings in the analyzer.
- There are
- A PR to
develop:- Bumps the version correctly.
- Requires a CHANGELOG.
- Validates tests/analyzer/format.
- A PR to
masterblocks if the version is not higher. - All protection rules prevent direct push.
- The complete flow (
dev→rev→develop→master) works without manual intervention.
Documentation
Proper documentation is key for maintainability and onboarding new developers. We need to:
- Update the repository's README with:
- Rulesets
- Branch structure
- Usage of labels for versioning
- Workflows and their purpose
- Create a file
.github/GUIDE_CI_CD.mdwith a detailed guide. - Include examples of commands for devs.
- Attach a diagram of the CI/CD flow.
Additional Notes
- This system is compatible with any Flutter or Dart repo in the ecosystem.
- Automating the version bump prevents conflicts and ensures semantic versioning.
- The
rev/**branches allow integrating multiple contributions without commit noise. - This issue serves as a template for standardizing new repositories.
References
- Workflow oficial jocaagura
- Documentación de GitHub Actions
- GuÃa de branching del proyecto
- SemVer.org
By implementing this standardized CI/CD pipeline, we ensure that every project within the jocaagura ecosystem benefits from consistent, high-quality code, streamlined workflows, and reliable releases. This not only makes our lives easier but also boosts developer productivity and project success. Cheers to better code and smoother deployments!