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

Fix Bad Request on Open GitHub Issue report when URL is too long #504

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

exigow
Copy link
Contributor

@exigow exigow commented Feb 6, 2024

Motivation: If the URL is too long (mainly because of stacktrace), GitHub blocks the issues/new endpoint. User is facing Bad Request.

Also: I've added few improvements.

Test plan

  1. Add error("test") to CodyToolWindowContent constructor.

Demo


Selection_072


Selection_070

@exigow exigow self-assigned this Feb 6, 2024
@exigow
Copy link
Contributor Author

exigow commented Feb 6, 2024

Similar problem: VirtusLab/git-machete-intellij-plugin#1008 (thx @mkondratek )

@exigow exigow changed the title Bugfix: Trim Report To GitHub errors Bugfix: Trim Open GitHub Issue errors Feb 6, 2024
@exigow
Copy link
Contributor Author

exigow commented Feb 12, 2024

Looks like max length for GH URL is 2^13 (8192).

@exigow
Copy link
Contributor Author

exigow commented Feb 12, 2024

TODO: Verify this 8192 max length in tests (eg send issue report with 8192 + 1 length and expect Bad Request).

@exigow exigow changed the title Bugfix: Trim Open GitHub Issue errors Fix Bad Request on Open GitHub Issue report when URL is too long Feb 13, 2024
@exigow exigow marked this pull request as ready for review February 13, 2024 12:50
Also: I've added few improvements.

Test plan

1. Add error("test") to CodyToolWindowContent constructor.
Copy link
Contributor

@pkukielka pkukielka left a comment

Choose a reason for hiding this comment

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

LGTM

@pkukielka pkukielka merged commit d22e787 into main Feb 13, 2024
2 checks passed
@pkukielka pkukielka deleted the exigow/trim-github-errors branch February 13, 2024 16:10
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.

2 participants