RFR: 1734: Reduce disk usage in pr bot

Zhao Song zsong at openjdk.org
Thu Mar 23 20:13:40 UTC 2023

On Thu, 23 Mar 2023 19:57:02 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> This is a very minimal patch that does solve the issue. However, I don't like that IntegrateCommand has to know to call `getParent` on the scratchPath it gets to be able to resolve the correct path for a repo. I think we should hide this knowledge behind an abstraction. Instead of sending `Path scratchPath` around, we could define a new class `ScratchArea` that has methods for generating paths.
> `ScratchArea` is initialized with a Path object. This could happen in `PullRequestWorkItem::run` and `prRun` can be changed to take a `ScratchArea` instance. `ScratchArea.get(Repository)` would return a global repository path for that repository. `ScratchArea.get(CommandHandler)` would return a path suitable for that command. `ScratchArea.get(WorkItem)` would return a path suitable for that WorkItem.
> This would move the knowledge of the exact file layout to this class, so individual WorkItems or commands wouldn't need to know the directory hierarchy themselves.

It's quite a good idea. Will do it.


PR Comment: https://git.openjdk.org/skara/pull/1491#issuecomment-1481830060

More information about the skara-dev mailing list