Skip to content

stream bulk #9308

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

Closed
wants to merge 3 commits into from
Closed

stream bulk #9308

wants to merge 3 commits 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

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

Copilot Autofix

AI 3 months ago

To fix the problem, we need to ensure that the integer value obtained from strconv.Atoi is within the bounds of the uint32 type before performing the conversion. This can be done by adding a check to ensure the value is non-negative and does not exceed the maximum value of uint32.

The best way to fix this is to use strconv.ParseUint with a bit size of 32, which directly parses the string into a uint32 value, ensuring that the value is within the valid range for uint32. This approach avoids the need for additional bounds checking.

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
@@ -127,3 +127,3 @@
 		if entry.IsDir() {
-			groupID, err := strconv.Atoi(entry.Name())
+			groupID, err := strconv.ParseUint(entry.Name(), 10, 32)
 			if err == nil {
EOF
@@ -127,3 +127,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.
Unable to commit as this autofix suggestion is now outdated
Copy link

trunk-io bot commented Mar 3, 2025

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
TestImportApis Error getting p directories: open /home/shiva/workspace/dgraph-work/benchmarks/data/out: no such file or directory Logs ↗︎

View Full Report ↗︎Docs

@shivaji-kharse shivaji-kharse force-pushed the shiva/stream-bulk branch 2 times, most recently from 57ab93a to 2d973be Compare March 10, 2025 16:49
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