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

PortAddonPullRequest: reduce noise by filtering PRs to port #67

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sebalix
Copy link
Collaborator

@sebalix sebalix commented Jan 6, 2025

Address issue #21

PRs that are updating both the analyzed module + other ones (here called 'satellite') were listed by oca-port, even if the commits related to the analyzed module were already ported, because contributions on these satellite modules were not (yet) ported.

In the context of the analyzed module, this brings noise and such PR should not be proposed to be ported, but only mentioned.

There are now two kinds of detected PRs:

  • the ones that are updating the current analyzed module: they are proposed to the user as "to be ported" as usual
  • the ones where only satellite modules/files remain to be ported: such modules are now listed (in verbose mode), and the user invited to run oca-port on them.

As such PRs with commits updating only satellite modules are not proposed anymore to the user, some modules will now be considered as "Fully ported" instead of still having some "Commits to port", which is accurate from a reporting POV 🎉

Example of interactive output on shopfloor_mobile from OCA/wms:
image

Example of JSON output on stock_storage_type from OCA/wms:
$ oca-port origin/14.0 origin/16.0 stock_storage_type --verbose --dry-run --output=json | jq .
Before

{
  "process": "port_commits",
  "results": {
    "258": {
      "url": "https://github.com/OCA/wms/pull/258",
      "ref": "OCA/wms#258",
      "author": "sebalix",
      "title": "[13.0->14.0][oca-port-pr-#58] Add stock_storage_type_buffer",
      "merged_at": "2021-08-04T10:25:21Z",
      "missing_commits": [
        "642de1b44a5789900ee42cccb58bd3dd29451cdd",
        "dc09fb6f2834059e05bc3de9377204d589fc3ad8",
        "7775e31b8e6ec7a5dd48a0c081cd429375b9b89e"
      ]
    }
  }
}

After

{}  # Now considered as "Fully ported"

Still in OCA/wms repository, for shopfloor module this reduces the number of PRs to port from 34 to 11.

TODO

  • fix & add tests

@sebalix sebalix added enhancement New feature or request work in progress labels Jan 6, 2025
@sebalix sebalix added this to the 0.18 milestone Jan 6, 2025
@sebalix sebalix force-pushed the split-sat-prs branch 3 times, most recently from d11d902 to 0899d9b Compare January 6, 2025 15:16
@sebalix sebalix marked this pull request as ready for review January 6, 2025 15:18
@sebalix sebalix force-pushed the split-sat-prs branch 2 times, most recently from 79b18f9 to c903527 Compare January 9, 2025 14:29
PRs that are updating both the analyzed module + other ones (here called
'satellite') were listed by oca-port, even if the commits related to the
analyzed module were already ported, because contributions on these
satellite modules were not (yet) ported.

In the context of the analyzed module, this brings noise and such PR
should not be proposed to be ported, but only mentioned.

There are now two kinds of detected PRs:

- the ones that are updating the current analyzed module: they are
  proposed to the user as "to be ported" as usual
- the ones that are updating only satellite modules/files:
- the ones where only satellite modules/files remain to be ported: such
  modules are now listed (in verbose mode), and the user invited to run
  oca-port on them.

As such PRs with commits updating only satellite modules are not
proposed anymore to the user, some modules will now be considered as
"Fully ported" instead of still having some "Commits to port".
… PRs

Display ported PRs as list in PR description, even if only one has been
ported, so platforms like GitHub can render such list nicely with
helpful information (PR title, color and status).
As the underlying dict is a nested dictionary which sets automatically a
value for each accessed key, accessing the commit_sha directly even if
it doesn't exist was updating the cache for nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant