Skip to content

fix(git): add more robust error handling for Git operation#579

Merged
mathio merged 2 commits intolingodotdev:mainfrom
SXsid:main
Mar 26, 2025
Merged

fix(git): add more robust error handling for Git operation#579
mathio merged 2 commits intolingodotdev:mainfrom
SXsid:main

Conversation

@SXsid
Copy link
Copy Markdown
Contributor

@SXsid SXsid commented Mar 25, 2025

Resolves #571

@SXsid
Copy link
Copy Markdown
Contributor Author

SXsid commented Mar 25, 2025

it has some changes of #573 but the bibucet gitconifg methos doesn't include the git command, which can be refactored

// Check if PR exists
this.ora.start(
`Checking for existing PR with head ${i18nBranchName} and base ${this.platformKit.platformConfig.baseBranchName}`,
`Checking for existing PR with head ${i18nBranchName} and base ${this.platformKit.platformConfig.baseBranchName}`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for running the prettier!

Comment thread action/src/platforms/git-utils.ts Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's not add a new utils file. Parent PlatformKit class has gitConfig() method that can be used for any common logic using super.gitConfig(...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Issue #573 mentioned creating a new file, so should I revert the multi-platform refactoring change?

Copy link
Copy Markdown
Contributor

@mathio mathio Mar 26, 2025

Choose a reason for hiding this comment

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

I am not saying not to do it, just to do it a bit differently than what the issue suggests.

However lets keep the PRs one issue at a time. This looks good now.

Comment thread action/src/platforms/github.ts Outdated
execSync(`git remote set-url origin https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`, {
stdio: "inherit",
});
const URL = `https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's use lowercase "url" for variables like this:

Suggested change
const URL = `https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`;
const url = `https://${ghToken}@github.com/${repositoryOwner}/${repositoryName}.git`;

@SXsid SXsid requested a review from mathio March 26, 2025 16:59
@mathio mathio merged commit 0191bf9 into lingodotdev:main Mar 26, 2025
2 checks passed
mainstar123 pushed a commit to mainstar123/lingo.dev that referenced this pull request Jul 7, 2025
17prateek12 pushed a commit to 17prateek12/lingo.dev that referenced this pull request Jan 23, 2026
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.

Integration Modules (/action and /integrations): Add more robust error handling for Git operations

2 participants