Skip to content

Refactor pathsfilter tool for better quality #13194

Open
@szumejker

Description

@szumejker

Description

While presenting the code to the team at a meeting, we determined that the tool code should be refactored.

Reasons

The code in its current form is not of sufficient quality and is therefore unreadable.

Acceptance Criteria

The code is refactored based on the findings:

  • Changing the names of fields in objects and function parameters so that they precisely describe what they are for.
  • Removing the GetChangedFiles method because the list of changed files will be passed as an application input parameter from GitHub Action.
  • Refactoring the logic responsible for reading the path to the output so that it is passed as an application input parameter and not as env.
  • Parameters used in the function that creates an instance of a given object should be interfaces for Dependency Inversion compliance.
  • Research whether there is a common field in github.event in the controller that can be used to pass application input parameters, e.g. base, head, target-branch-name.
  • Removing the getRefs step from the controller, which is responsible for creating variables e.g. base_sha, head_sha, target_branch that are passed in the pathFilters step in order to get rid of unnecessary conditions checking the event name and replacing it with conditions in the pathFilters step.
  • Handling configuration errors (e.g., missing keys in YAML, incorrect structure) and reporting them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ciIssues or PRs related to CI related topicskind/featureCategorizes issue or PR as related to a new feature.team-goal

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions