-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[No QA] Fix git diff failure in translation workflow #71623
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
Changes from all commits
1c19655
ae2db77
c54ed9d
55b86af
ab35cab
1cb1cc1
9904fa7
4b15212
c93b13d
5260919
d95bf47
6a66ace
454cd09
304d069
ad59685
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| name: Translation Dry Run | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated to the other changes here. Just :eye_twitch: |
||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ const GIT_ERRORS = { | |
|
|
||
| /** | ||
| * Represents a single changed line in a git diff. | ||
| * With -U0, only added and removed lines are present (no context). | ||
| * Only added and removed lines are tracked (context lines are skipped during parsing). | ||
| */ | ||
| type DiffLine = { | ||
| number: number; | ||
|
|
@@ -64,7 +64,7 @@ class Git { | |
| */ | ||
| static isValidRef(ref: string): boolean { | ||
| try { | ||
| execSync(`git rev-parse --verify "${ref}"`, { | ||
| execSync(`git rev-parse --verify "${ref}^{object}"`, { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Good FixExcellent fix! Using |
||
| encoding: 'utf8', | ||
| cwd: process.cwd(), | ||
| stdio: 'pipe', // Suppress output | ||
|
|
@@ -200,6 +200,9 @@ class Git { | |
| type: 'removed', | ||
| content, | ||
| }); | ||
| } else if (firstChar === ' ') { | ||
| // Context line - skip it (we only care about added/removed lines) | ||
| continue; | ||
| } else { | ||
| throw new Error(`Unknown line type! First character of line is ${firstChar}`); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -576,6 +576,7 @@ const translations = { | |
| tax: 'Tax', | ||
| shared: 'Shared', | ||
| drafts: 'Drafts', | ||
| // @context as a noun, not a verb | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Good Context DocumentationGreat addition of context comments! These @context comments help translators understand the intended meaning and ensure accurate translations. This is a best practice for internationalization. |
||
| draft: 'Draft', | ||
| finished: 'Finished', | ||
| upgrade: 'Upgrade', | ||
|
|
@@ -604,6 +605,7 @@ const translations = { | |
| disabled: 'Disabled', | ||
| import: 'Import', | ||
| offlinePrompt: "You can't take this action right now.", | ||
| // @context meaning "remaining to be paid, done, or dealt with", not "exceptionally good" | ||
| outstanding: 'Outstanding', | ||
| chats: 'Chats', | ||
| tasks: 'Tasks', | ||
|
|
@@ -628,6 +630,7 @@ const translations = { | |
| downloadAsCSV: 'Download as CSV', | ||
| help: 'Help', | ||
| expenseReports: 'Expense Reports', | ||
| // @context Rate as a noun, not a verb | ||
| rateOutOfPolicy: 'Rate out of policy', | ||
| reimbursable: 'Reimbursable', | ||
| editYourProfile: 'Edit your profile', | ||
|
|
@@ -1688,6 +1691,7 @@ const translations = { | |
| general: 'General', | ||
| }, | ||
| closeAccountPage: { | ||
| // @context close as a verb, not an adjective | ||
| closeAccount: 'Close account', | ||
| reasonForLeavingPrompt: 'We’d hate to see you go! Would you kindly tell us why, so we can improve?', | ||
| enterMessageHere: 'Enter message here', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why a 60 minute timeout? That seems long
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just copy/pasted this from auth. You'll notice that tmate only runs if
runner.debug == '1'. For context, what this does is suspend execution of the runner and open an ssh portal into the runner. Then you can ssh in and do whatever you want. When you close the ssh connection, the runner continues execution.The 60 minute timeout just means that you'd have 60 minutes to ssh in and debug whatever you want to debug. I agree it's kind of long, but 🤷🏼