How mercadolibre/fury-core-ci works
Main components of the system
• GitHub Repository & Webhooks: This is where events like pull requests and issue comments are generated. The workflow listens for GitHub events (e.g., pull_request events of various types and issue_comment events).
• GitHub Workflows: Found under .github/workflows (build.yml and tagging.yml). These files show when and how the CI run is triggered. The tagging workflow, in particular, drives the process using GitHub Action hooks.
• Custom GitHub Action: Defined by action.yml at the root. This descriptor outlines the action's inputs and environment setup. It ties to the business logic contained in the source files.
• Source Code & Build Output: The TypeScript source (index.ts) is compiled via the TypeScript compiler (using tsconfig.json) into JavaScript (located in the dist directory e.g., dist/index.js). This represents the core logic that processes the triggers and creates the appropriate tags.
• Versioning and Branching Conventions: Although not physical components in the file structure, these guidelines (outlined in the README) are integral to understanding how tagging is influenced by branch names and merge events.
Relationships and interactions
• GitHub events act as the trigger for the workflows defined in .github/workflows. When an event occurs (like a pull request being opened, synchronized, or an issue comment with "#tag"), GitHub sends a webhook.
• The workflow (from tagging.yml) then checks out the repository code using actions/checkout@v2.
• It subsequently runs the custom action included via the “uses” directive (mercadolibre/fury-core-ci@v1). This action is defined by action.yml and runs the logic compiled into dist/index.js.
• Finally, based on branch naming conventions and PR details (e.g., feature, fix, chore), the custom action creates and pushes the appropriate Git tag.
Architectural patterns and key technologies
• Event-Driven Architecture: The system reacts to GitHub webhooks and comments.
• Modular Build: Separation between source (index.ts) and built output (dist directory) with configuration managed by tsconfig.json.
• Continuous Integration and Deployment Pattern: Utilizing GitHub Actions and workflows to streamline tagging.
• Semantic Versioning: Embedded in the business rules and branching conventions that dictate tag creation.
Elements
• Clear, descriptive labels for every component (workflows, actions, source files, compilation step, triggers).
• Notes or callouts to show how branching conventions (e.g., feature/, fix/, release/) affect the variant of version increment (major, minor, patch).
Detailed architecture capture
• How the GitHub Action responds to event types.
• The flow from checkout to executing the custom action.
• How the tag creation logic integrates semantic versioning and branch naming rules.