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: gitlab plugins build #115

Merged
merged 3 commits into from
Oct 9, 2023
Merged

fix: gitlab plugins build #115

merged 3 commits into from
Oct 9, 2023

Conversation

rustatian
Copy link
Member

@rustatian rustatian commented Oct 9, 2023

Reason for This PR

  • Failure when trying to build plugins hosted on GitLab.

Description of Changes

  • Fix pseudo-version parsing for GitLab.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

PR Checklist

[Author TODO: Meet these criteria.]
[Reviewer TODO: Verify that these criteria are met. Request changes if not]

  • All commits in this PR are signed (git commit -s).
  • The reason for this PR is clearly provided (issue no. or explanation).
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this PR.
  • Any user-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.

Summary by CodeRabbit

Refactor:

  • Replaced local parseModuleInfo function with velox.ParseModuleInfo in github/parse_test.go and github/pool.go for improved modularity and maintainability.

New Feature:

  • Introduced ModulesInfo struct and associated functions in modulesInfo.go to extract version information from module names.

Bug Fix:

  • Enhanced error handling in gitlab/repo.go's GetPluginsModData function to handle edge cases related to commit count, commit SHA length, and commit date.

Chore:

  • Updated GitHub Actions workflow in .github/workflows/linux.yml to trigger on pull requests to the master branch, enhancing CI/CD pipeline.

Signed-off-by: Valery Piashchynski <[email protected]>
@rustatian rustatian added the B-bug Bug: bug, exception label Oct 9, 2023
@rustatian rustatian requested a review from wolfy-j October 9, 2023 12:39
@rustatian rustatian self-assigned this Oct 9, 2023
@coderabbitai
Copy link

coderabbitai bot commented Oct 9, 2023

Rate Limit Exceeded

@rustatian has exceeded the limit for the number of files or commits that can be reviewed per hour. Please wait 14 minutes and 30 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, convert this PR to a draft and then mark it as ready for review again to re-trigger the review. Alternatively, you can push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per repository.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 6826609 and 4388e5f.

Walkthrough

This pull request introduces the use of the velox package for parsing module information across various files, adds error handling in GetPluginsModData function, and extends the GitHub Actions workflow to trigger on pull requests.

Changes

File Summary
github/parse_test.go, github/pool.go Replaced parseModuleInfo with velox.ParseModuleInfo.
gitlab/repo.go Enhanced error handling in GetPluginsModData function and used velox.ParseModuleInfo for pseudo version generation.
modulesInfo.go Added new struct ModulesInfo, functions ParseModuleInfo and IsDigit, and imported necessary packages.
.github/workflows/linux.yml Extended workflow to trigger on pull requests to master branch.

"In the land of code, where logic is king, 🐇
A rabbit hopped in, changes to bring. 🎁
With velox in use, and errors in check, ✅
The code now runs smooth, as smooth as a trek. 🏞️
On pull requests too, the actions now spring, 🎬
Celebrate, dear coders, for joy this will bring!" 🎉


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • Mention @coderabbitai in any review comment for bot assistance.
  • Note: Review comments are made on code diffs or files, not on the PR overview.

Pause Incremental Reviews

  • Insert @coderabbitai: ignore in the PR description to halt the bot's ongoing reviews. Remove the line to resume.
  • Additionally, enter @coderabbitai pause to halt the bot's ongoing reviews as any issue or review comment. To
    resume reviews, enter @coderabbitai resume as any issue or review comment.

Signed-off-by: Valery Piashchynski <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 4

Commits Files that changed from the base of the PR and between 47d520f and eaa806f.
Files ignored due to filter (1)
  • velox_rr_v2023.toml
Files selected for processing (4)
  • github/parse_test.go (2 hunks)
  • github/pool.go (1 hunks)
  • gitlab/repo.go (1 hunks)
  • modulesInfo.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • github/parse_test.go
Additional comments (Suppressed): 8
gitlab/repo.go (7)
  • 102-103: No changes detected. The error handling for bad response status remains the same.

  • 106-108: The check for the number of commits has been updated to also handle the case where there are more than one commit. This is a good addition for ensuring that only one commit is selected.

  • 110-113: A new check has been added to ensure that the commit SHA is not too short. This is a good addition for ensuring data integrity.

  • 115-116: The commit SHA is now being truncated to the first 12 characters to comply with go.mod pseudo format specifications. This is a good change for ensuring compatibility with go.mod.

  • 118-121: A new check has been added to ensure that the commit date is not nil. This is a good addition for ensuring data integrity.

  • 123-123: The velox.ParseModuleInfo function is now being used to generate a pseudo version. This is a good change for ensuring accurate pseudo version generation.

  • 125-126: No changes detected. The handling for replacement paths remains the same.

github/pool.go (1)
  • 153-154: The new code is using the first 12 characters of the commit SHA for the Version and PseudoVersion. Ensure that this truncation does not cause any issues with versioning or conflict resolution. Also, verify that the velox.ParseModuleInfo function is compatible with the rest of your codebase and provides the same functionality as the old parseModuleInfo function.

modulesInfo.go Show resolved Hide resolved
modulesInfo.go Show resolved Hide resolved
modulesInfo.go Outdated Show resolved Hide resolved
github/pool.go Show resolved Hide resolved
Signed-off-by: Valery Piashchynski <[email protected]>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Commits Files that changed from the base of the PR and between eaa806f and 6826609.
Files selected for processing (1)
  • .github/workflows/linux.yml (1 hunks)
Files skipped from review due to trivial changes (1)
  • .github/workflows/linux.yml

@rustatian rustatian merged commit e947ded into master Oct 9, 2023
5 checks passed
@rustatian rustatian deleted the fix/gitlab-builds branch October 9, 2023 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-bug Bug: bug, exception
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant