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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add transforms for aliased built-ins #1048

Merged
merged 1 commit into from
Aug 18, 2023
Merged

fix: add transforms for aliased built-ins #1048

merged 1 commit into from
Aug 18, 2023

Conversation

zolamk
Copy link
Contributor

@zolamk zolamk commented Aug 18, 2023

Description

Adds missing transformers for aliased built-ins

Closes #1046

Summary generated by Reviewpad on 18 Aug 23 04:56 UTC

This pull request includes changes to the transform.go file. Here is a summary of the changes:

  1. Added the addDefaultsToRequestedReviewers function to format a string with requested reviewers.
  2. Added the addDefaultsToAddReviewers function to format a string with additional reviewers.
  3. Added the addDefaultGetSizeMethod function to replace a string with a default size method value.
  4. Added the addDefaultCountUserIssues function to replace a string with a default count of user issues.
  5. Added the addDefaultCountUserPullRequests function to replace a string with a default count of user pull requests.
  6. Added the addDefaultHasOnlyCompletedCheckRuns function to replace a string with a default check runs value.
  7. Added the addDefaultAddReviewersBasedOnCodeAuthor function to replace a string with a default code author value.
  8. Added the addDefaultsToAddAssignees function to format a string with additional assignees.
  9. Added the addEmptyFilterToContainsOnlyCodeWithoutSemanticChanges function to replace a string with an empty filter value.
  10. Modified the summarizeAlias and transformAladinoExpression functions.

Please let me know if you have any further questions or need additional assistance with the code review!

馃 Generated by Copilot at e591f5c

This pull request improves the testing and usability of some aladino functions in the engine package. It adds and modifies tests in engine/transform_internal_test.go to cover the new functions and the renamed $hasOnlyCompletedCheckRuns function. It also adds functions in engine/transform.go that provide default values for optional arguments of aladino functions such as $hasLabel, $hasMilestone, and $hasAssignee.

Code review and merge strategy

Ship: this pull request can be automatically merged and does not require code review

How

馃 Generated by Copilot at e591f5c

  • Add new functions to the engine package to simplify the usage of aladino functions and avoid errors when optional arguments are not provided (link, link, link, link, link, link, link)
  • Apply the new functions to the aladino expression in the transformAladinoExpression function (link)
  • Add new test cases to the TestTransformAladinoExpression function in the engine/transform_internal_test.go file to check the functionality and correctness of the new functions (link, link, link, link)
  • Rename the $haveAllChecksRunCompleted and $haveAnyChecksRunCompleted functions to $hasOnlyCompletedCheckRuns and modify the existing test cases accordingly (link)

@reviewpad reviewpad bot added ship Pull request can be automatically merged and does not require code review large large pull request labels Aug 18, 2023
Copy link

@reviewpad reviewpad bot left a comment

Choose a reason for hiding this comment

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

Pull request is in ship mode. Reviewpad will merge it.

@reviewpad reviewpad bot added this pull request to the merge queue Aug 18, 2023
Merged via the queue into main with commit 70997e8 Aug 18, 2023
4 checks passed
@ferreiratiago ferreiratiago deleted the fix/transforms branch August 18, 2023 07:53
Comment on lines +135 to +136
arg: "$pullRequestCountBy(\"john\") > 0",
wantVal: "$pullRequestCountBy(\"john\", \"all\") > 0",
Copy link
Member

Choose a reason for hiding this comment

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

This test does not look correct.

@reviewpad reviewpad bot added the waiting-approval Pull request is waiting for approval label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
large large pull request ship Pull request can be automatically merged and does not require code review waiting-approval Pull request is waiting for approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional parameters on the renamed built-ins stop working
2 participants