fix: add gh workflow to report crowdin that needs attention#33
Open
Bilb wants to merge 1 commit into
Open
Conversation
Comment on lines
+287
to
+288
| if resp.status_code >= 400: | ||
| sys.exit(f"Discord webhook failed ({resp.status_code}): {resp.text[:300]}") |
Collaborator
There was a problem hiding this comment.
I don't think this code will be hit (r.raise_for_status in request_with_retry throws so we wouldn't get here)
Comment on lines
+55
to
+58
| # Discord limits: 10 embeds/message, 4096 chars/description, 25 fields, 6000 | ||
| # chars total/message. We stay well under these. | ||
| MAX_EMBEDS_PER_MESSAGE = 10 | ||
| MAX_DESC_CHARS = 3800 |
Collaborator
There was a problem hiding this comment.
Looks like the 6000 char limit is based on the combined total across all embeds so if we got a bunch of translations for long strings (eg. Pro) then we could hit it over multiple embeds
|
|
||
| def post_to_discord(session, webhook_url, messages): | ||
| for payload in messages: | ||
| resp = request_with_retry(session, "POST", webhook_url, json=payload) |
Collaborator
There was a problem hiding this comment.
Don't know if we want to catch this and post an error message to Discord here?
Just thinking something like the 6000 char limit in my previous comment would result in a 400 error which would fail the run, but I think only the person that triggered the run gets an email (not sure that happens with cron-job based actions)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.