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

stream bulk #9308

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

stream bulk #9308

wants to merge 1 commit into from

Conversation

shivaji-kharse
Copy link
Contributor

Description

Please explain the changes you made here.

Checklist

  • Code compiles correctly and linting passes locally
  • For all code changes, an entry added to the CHANGELOG.md file describing and linking to
    this PR
  • Tests added for new functionality, or regression tests for bug fixes added as applicable
  • For public APIs, new features, etc., PR on
    docs repo staged and linked here

Instructions

  • The PR title should follow the Conventional Commits
    syntax, leading with fix:, feat:, chore:, ci:, etc.
  • The description should briefly explain what the PR is about. In the case of a bugfix, describe or
    link to the bug.
  • In the checklist section, check the boxes in that are applicable, using [x] syntax.
    • If not applicable, remove the entire line. Only leave the box unchecked if you intend to come
      back and check the box later.
  • Delete the Instructions line and everything below it, to indicate you have read and are
    following these instructions. 🙂

Thank you for your contribution to Dgraph!

@shivaji-kharse shivaji-kharse changed the title Shiva/stream bulk stream bulk Feb 17, 2025
@shivaji-kharse shivaji-kharse marked this pull request as ready for review March 3, 2025 11:53
@shivaji-kharse shivaji-kharse requested a review from a team as a code owner March 3, 2025 11:53
@github-actions github-actions bot added area/testing Testing related issues area/core internal mechanisms go Pull requests that update Go code labels Mar 3, 2025
if err == nil {
pDir := filepath.Join(basePath, entry.Name(), "p")
if _, err := os.Stat(pDir); err == nil {
groupDirs[uint32(groupID)] = pDir

Check failure

Code scanning / CodeQL

Incorrect conversion between integer types High

Incorrect conversion of an integer with architecture-dependent bit size from
strconv.Atoi
to a lower bit size type uint32 without an upper bound check.

Copilot Autofix AI 7 days ago

To fix the problem, we need to ensure that the value parsed from the directory name is within the valid range for uint32 before performing the conversion. We can achieve this by using strconv.ParseUint with a bit size of 32, which directly parses the string into a uint32 value. This approach avoids the need for an additional bounds check.

Suggested changeset 1
edgraph/import.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/edgraph/import.go b/edgraph/import.go
--- a/edgraph/import.go
+++ b/edgraph/import.go
@@ -126,3 +126,3 @@
 		if entry.IsDir() {
-			groupID, err := strconv.Atoi(entry.Name())
+			groupID, err := strconv.ParseUint(entry.Name(), 10, 32)
 			if err == nil {
EOF
@@ -126,3 +126,3 @@
if entry.IsDir() {
groupID, err := strconv.Atoi(entry.Name())
groupID, err := strconv.ParseUint(entry.Name(), 10, 32)
if err == nil {
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Copy link

trunk-io bot commented Mar 3, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core internal mechanisms area/testing Testing related issues go Pull requests that update Go code
Development

Successfully merging this pull request may close these issues.

1 participant