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

Add flag max-buffer-size #505

Merged
merged 4 commits into from Jul 19, 2023

Conversation

FabioPinheiro
Copy link
Contributor

I would like to add the scala-steward's flag max-buffer-size.
But I have no idea how to test this.

github-actions bot added a commit that referenced this pull request Jun 28, 2023
@alejandrohdezma
Copy link
Member

Hey @FabioPinheiro, you can use this snapshot release to test the feature if you want before merging this PR.

@alejandrohdezma
Copy link
Member

Hey @FabioPinheiro, did you manage to test this?

github-actions bot added a commit that referenced this pull request Jul 6, 2023
github-actions bot added a commit that referenced this pull request Jul 19, 2023
@FabioPinheiro
Copy link
Contributor Author

Hey @alejandrohdezma
Sorry for the delay. Yes I just tested
Seems to be working.

I configured the GitHub action with the setting max-buffer-size: 26000
https://github.com/FabioPinheiro/scala-did/actions/runs/5598337126/jobs/10237849664
I get the following error as expected (which is the same as when I use the Steward on the docker with that setting)
fs2.text$LineTooLongException: Max line size is 26000 but 32768 chars have been accumulated

Where previously it was
https://github.com/FabioPinheiro/scala-did/actions/runs/4996284159/jobs/8949272212
fs2.text$LineTooLongException: Max line size is 16384 but 24576 chars have been accumulated (the defualt)

So I think it's working as expected

@alejandrohdezma
Copy link
Member

Perfect! Thank you! I'll merge as soon as CI passes 😊

github-actions bot added a commit that referenced this pull request Jul 19, 2023
@github-actions
Copy link
Contributor

A snapshot release has been created as snapshots/505.

You can test it out with:

uses: scala-steward-org/scala-steward-action@snapshots/505

It will be automatically recreated on any change to this PR.

@github-actions
Copy link
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
core 100% 100% 0
modules 69% 86% 0
Summary 70% (465 / 662) 87% (76 / 87) 0

@alejandrohdezma alejandrohdezma merged commit e8a85e9 into scala-steward-org:master Jul 19, 2023
2 checks passed
fthomas added a commit to scala-steward-org/scala-steward that referenced this pull request Jul 19, 2023
This wraps the `fs2.text.LineTooLongException` that is thrown by
`fs2.text.linesLimited` which is used in `process.slurp` to enrich the
error message with more helpful information.

Instead of this:
```
2023-07-19 15:34:45,215 ERROR Steward scala-steward-org/test-repo-1 failed
fs2.text$LineTooLongException: Max line size is 50 but 79 chars have been accumulated
	at fs2.text$.$anonfun$linesImpl$1(text.scala:553)
	...
```
we now get this:
```
2023-07-19 16:02:41,546 ERROR Steward scala-steward-org/test-repo-1 failed
org.scalasteward.core.io.process$ProcessLineTooLongException: 'mvn --batch-mode dependency:list -DexcludeTransitive=true' outputted a line longer than 50 chars. If the process executed normally and the buffer size is just too small, you can increase it with the --max-buffer-size command-line option and/or open a pull request in https://github.com/scala-steward-org/scala-steward that increases the default buffer size.
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany.app:my-app >----------------------
[INFO] Building my-app 1.0-SNAPSHOT
	at org.scalasteward.core.io.process$$anonfun$1.applyOrElse(process.scala:69)
	...
Caused by: fs2.text$LineTooLongException: Max line size is 50 but 65 chars have been accumulated
	at fs2.text$.$anonfun$linesImpl$1(text.scala:553)
	...
```
which includes now
 * the command that led to the exception
 * the reason why this exception was raised (outputted line is too long)
 * guidance how to avoid it
 * the output of the process before the exception is raised
 * the original exception

This change was motivated by the unhelpful error shown in
scala-steward-org/scala-steward-action#505 (comment).
xerial added a commit to xerial/scala-steward-repos that referenced this pull request Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants