nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: codecov/uploader
Pull request #404 (2021-10-01 14:00:29)

fix: use `DRONE_REPO`


Patch:
diff --git a/src/ci_providers/provider_drone.ts b/src/ci_providers/provider_drone.ts
index bcf9184..a938c93 100644
--- a/src/ci_providers/provider_drone.ts
+++ b/src/ci_providers/provider_drone.ts
@@ -30,7 +30,7 @@ function _getPR(inputs: UploaderInputs): string {
 }
 
 function _getService(): string {
-  return 'drone'
+  return 'drone.io'
 }
 
 export function getServiceName(): string {
@@ -44,7 +44,7 @@ function _getSHA(inputs: UploaderInputs): string {
 
 function _getSlug(inputs: UploaderInputs): string {
   const { args, environment: envs } = inputs
-  return args.slug || envs.DRONE_REPO_LINK || ''
+  return args.slug || envs.DRONE_REPO || ''
 }
 
 export function getServiceParams(inputs: UploaderInputs): IServiceParams {
@@ -68,6 +68,6 @@ export function getEnvVarNames(): string[] {
     'DRONE_BUILD_URL',
     'DRONE_COMMIT_SHA',
     'DRONE_PULL_REQUEST',
-    'DRONE_REPO_LINK',
+    'DRONE_REPO',
   ]
 }


Test patch:
diff --git a/test/providers/provider_drone.test.ts b/test/providers/provider_drone.test.ts
index 4b3d38d..b8d70cd 100644
--- a/test/providers/provider_drone.test.ts
+++ b/test/providers/provider_drone.test.ts
@@ -47,7 +47,7 @@ describe('Drone Params', () => {
         DRONE_BUILD_NUMBER: '2',
         DRONE_PULL_REQUEST: '1',
         DRONE_BUILD_URL: 'https://www.drone.io/',
-        DRONE_REPO_LINK: 'https:/example.com/repo',
+        DRONE_REPO: 'repo',
       },
     }
     const expected: IServiceParams = {
@@ -57,8 +57,8 @@ describe('Drone Params', () => {
       commit: 'testingsha',
       job: '',
       pr: '1',
-      service: 'drone',
-      slug: 'https:/example.com/repo',
+      service: 'drone.io',
+      slug: 'repo',
     }
     const params = providerDrone.getServiceParams(inputs)
     expect(params).toMatchObject(expected)
Repository: codecov/uploader
Pull request #413 (2021-10-06 10:40:13)

fix: 🐛 Preserve LF in the report file names list
Fixes #411


Patch:
diff --git a/src/helpers/files.ts b/src/helpers/files.ts
index 39bae8f..71e02f5 100644
--- a/src/helpers/files.ts
+++ b/src/helpers/files.ts
@@ -6,7 +6,7 @@ import { posix as path } from 'path'
 import { UploaderArgs } from '../types'
 import { logError, verbose } from './logger'
 
-export const MARKER_NETWORK_END = '<<<<<< network\n'
+export const MARKER_NETWORK_END = '\n<<<<<< network\n'
 export const MARKER_FILE_END = '<<<<<< EOF\n'
 export const MARKER_ENV_END = '<<<<<< ENV\n'
 
@@ -22,7 +22,7 @@ export async function getFileListing(
   projectRoot: string,
   args: UploaderArgs,
 ): Promise<string> {
-  return getAllFiles(projectRoot, projectRoot, args).join('')
+  return getAllFiles(projectRoot, projectRoot, args).join('\n')
 }
 
 export function manualBlacklist(): string[] {
@@ -262,16 +262,13 @@ export function getAllFiles(
     error,
   } = spawnSync('git', ['-C', dirPath, 'ls-files'], { encoding: 'utf8' })
 
-  if (error instanceof Error || status !== 0) {
-    return glob
+  return error instanceof Error || status !== 0
+    ? glob
       .sync(['**/*', '**/.[!.]*'], {
         cwd: dirPath,
         ignore: manualBlacklist().map(globstar),
       })
-      .map(file => `${file}\n`)
-  } else {
-    return stdout.split(/[\r\n]+/)
-  }
+    : stdout.split(/[\r\n]+/)
 }
 
 /**


Test patch:
diff --git a/test/helpers/files.test.ts b/test/helpers/files.test.ts
index 1bf3247..cb3b669 100644
--- a/test/helpers/files.test.ts
+++ b/test/helpers/files.test.ts
@@ -11,7 +11,7 @@ describe('File Helpers', () => {
   })
 
   it('provides network end marker', () => {
-    expect(fileHelpers.MARKER_NETWORK_END).toBe('<<<<<< network\n')
+    expect(fileHelpers.MARKER_NETWORK_END).toBe('\n<<<<<< network\n')
   })
 
   it('provides file end marker', () => {
Repository: codecov/uploader
Pull request #532 (2021-12-03 17:50:53)

fix: alternative env vars for drone build url
See e.g. https://0-8-0.docs.drone.io/environment-reference/


Patch:
diff --git a/src/ci_providers/provider_drone.ts b/src/ci_providers/provider_drone.ts
index 940a816..7313959 100644
--- a/src/ci_providers/provider_drone.ts
+++ b/src/ci_providers/provider_drone.ts
@@ -14,7 +14,7 @@ function _getBuild(inputs: UploaderInputs): string {
 
 function _getBuildURL(inputs: UploaderInputs): string {
   const { environment: envs } = inputs
-  return envs.DRONE_BUILD_URL || ''
+  return envs.DRONE_BUILD_LINK || envs.DRONE_BUILD_URL || envs.CI_BUILD_URL || ''
 }
 
 function _getBranch(inputs: UploaderInputs): string {


Test patch:
diff --git a/test/providers/provider_drone.test.ts b/test/providers/provider_drone.test.ts
index bea9b91..2062ec1 100644
--- a/test/providers/provider_drone.test.ts
+++ b/test/providers/provider_drone.test.ts
@@ -33,6 +33,34 @@ describe('Drone Params', () => {
   })
 
   it('gets correct params', () => {
+    const inputs: UploaderInputs = {
+      args: { ...createEmptyArgs() },
+      environment: {
+        CI: 'true',
+        DRONE: 'true',
+        DRONE_BRANCH: 'master',
+        DRONE_COMMIT_SHA: 'testingsha',
+        DRONE_BUILD_NUMBER: '2',
+        DRONE_PULL_REQUEST: '1',
+        DRONE_BUILD_LINK: 'https://www.drone.io/',
+        DRONE_REPO: 'testOrg/testRepo',
+      },
+    }
+    const expected: IServiceParams = {
+      branch: 'master',
+      build: '2',
+      buildURL: 'https://www.drone.io/',
+      commit: 'testingsha',
+      job: '',
+      pr: '1',
+      service: 'drone.io',
+      slug: 'testOrg/testRepo',
+    }
+    const params = providerDrone.getServiceParams(inputs)
+    expect(params).toMatchObject(expected)
+  })
+  
+  it('gets correct params for DRONE_BUILD_URL', () => {
     const inputs: UploaderInputs = {
       args: { ...createEmptyArgs() },
       environment: {
Repository: codecov/uploader
Pull request #617 (2022-02-05 18:13:40)

fix: include coverage files
`contains` was inadvertently passed as an option to micromatch in [`filterFilesAgainstBlockList`]:

https://github.com/codecov/uploader/blob/7a9a54e245e629c9a1c8891352cf6941ae4d2496/src/helpers/files.ts#L339-L341

https://github.com/codecov/uploader/pull/577#discussion_r787846281

Tests now specifically cover the following files:

- coverage.info[^1]
- coverage.opencover.xml[^2]
- gap-coverage.json[^3]

[`filterFilesAgainstBlockList`]: https://github.com/codecov/uploader/blob/7a9a54e245e629c9a1c8891352cf6941ae4d2496/src/helpers/files.ts#L339-L341

[^1]: https://github.com/codecov/uploader/issues/614#issuecomment-1030237895
[^2]: https://github.com/codecov/uploader/issues/614#issuecomment-1030371776
[^3]: https://github.com/codecov/uploader/issues/614#issuecomment-1030662555


Patch:
diff --git a/src/helpers/files.ts b/src/helpers/files.ts
index f93b4dd..515463a 100644
--- a/src/helpers/files.ts
+++ b/src/helpers/files.ts
@@ -337,7 +337,7 @@ export function getBlocklist(): string[] {
 }
 
 export function filterFilesAgainstBlockList(paths: string[], ignoreGlobs: string[]): string[] {
-  return micromatch.not(paths, ignoreGlobs, {contains: true, windows: true})
+  return micromatch.not(paths, ignoreGlobs, {windows: true})
 }
 
 export function cleanCoverageFilePaths(projectRoot: string, paths: string[]): string[] {


Test patch:
diff --git a/test/helpers/files.test.ts b/test/helpers/files.test.ts
index 2016a95..3e9ddd0 100644
--- a/test/helpers/files.test.ts
+++ b/test/helpers/files.test.ts
@@ -320,6 +320,15 @@ describe('File Helpers', () => {
     it("ignores codecov configs by default", async () => {
       expect(fileHelpers.filterFilesAgainstBlockList(await getPaths(), getBlocklist())).not.toContainEqual(expect.stringMatching(/^\.?codecov\.ya?ml/))
     })
+
+    it.each([
+      "coverage.info",
+      "coverage.opencover.xml",
+      "gap-coverage.json",
+    ])("includes %s", (file) => {
+      expect(fileHelpers.filterFilesAgainstBlockList([file], getBlocklist()))
+        .toContainEqual(expect.stringMatching(file))
+    })
   })
 
   it('can remove a file', () => {
Repository: codecov/uploader
Pull request #619 (2022-02-05 20:25:00)

Release 0.1.17
- #617 


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a8e2037..562e940 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,12 @@
 
 All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
 
+### [0.1.17](https://github.com/codecov/uploader/compare/v0.1.16...v0.1.17) (2022-02-05)
+
+### Bug Fixes
+
+- include coverage files ([be55721](https://github.com/codecov/uploader/commit/be557213955389bd9ec7d19e2ddae0f3ce4566ff))
+
 ### [0.1.16](https://github.com/codecov/uploader/compare/v0.1.15...v0.1.16) (2022-02-03)
 
 ### Features
diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json
index 850dd03..f561531 100644
--- a/npm-shrinkwrap.json
+++ b/npm-shrinkwrap.json
@@ -1,12 +1,12 @@
 {
   "name": "@codecov/uploader",
-  "version": "0.1.16",
+  "version": "0.1.17",
   "lockfileVersion": 2,
   "requires": true,
   "packages": {
     "": {
       "name": "@codecov/uploader",
-      "version": "0.1.16",
+      "version": "0.1.17",
       "license": "ISC",
       "dependencies": {
         "fast-glob": "3.2.11",
diff --git a/package.json b/package.json
index 475e9b6..701c1d9 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@codecov/uploader",
-  "version": "0.1.16",
+  "version": "0.1.17",
   "description": "Codecov Report Uploader",
   "private": true,
   "bin": {
diff --git a/src/helpers/files.ts b/src/helpers/files.ts
index f93b4dd..515463a 100644
--- a/src/helpers/files.ts
+++ b/src/helpers/files.ts
@@ -337,7 +337,7 @@ export function getBlocklist(): string[] {
 }
 
 export function filterFilesAgainstBlockList(paths: string[], ignoreGlobs: string[]): string[] {
-  return micromatch.not(paths, ignoreGlobs, {contains: true, windows: true})
+  return micromatch.not(paths, ignoreGlobs, {windows: true})
 }
 
 export function cleanCoverageFilePaths(projectRoot: string, paths: string[]): string[] {


Test patch:
diff --git a/test/helpers/files.test.ts b/test/helpers/files.test.ts
index 2016a95..3e9ddd0 100644
--- a/test/helpers/files.test.ts
+++ b/test/helpers/files.test.ts
@@ -320,6 +320,15 @@ describe('File Helpers', () => {
     it("ignores codecov configs by default", async () => {
       expect(fileHelpers.filterFilesAgainstBlockList(await getPaths(), getBlocklist())).not.toContainEqual(expect.stringMatching(/^\.?codecov\.ya?ml/))
     })
+
+    it.each([
+      "coverage.info",
+      "coverage.opencover.xml",
+      "gap-coverage.json",
+    ])("includes %s", (file) => {
+      expect(fileHelpers.filterFilesAgainstBlockList([file], getBlocklist()))
+        .toContainEqual(expect.stringMatching(file))
+    })
   })
 
   it('can remove a file', () => {
Repository: codecov/uploader
Pull request #640 (2022-02-22 13:44:07)

fix: provider_local accepts envvars
[CODE-972] Add support for GIT_COMMIT, GIT_BRANCH and BRANCH_NAME to provider_local.

Those env vars were supported in [codecov-bash](https://github.com/codecov/codecov-bash/tree/43c5d3c7147b91674dd69c3e0e0becc48eba04bd). 

[CODE-972]: https://codecovio.atlassian.net/browse/CODE-972?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ


Patch:
diff --git a/src/ci_providers/provider_local.ts b/src/ci_providers/provider_local.ts
index 8a2b09d..cb84d74 100644
--- a/src/ci_providers/provider_local.ts
+++ b/src/ci_providers/provider_local.ts
@@ -17,9 +17,10 @@ function _getBuildURL(): string {
 }
 
 function _getBranch(inputs: UploaderInputs): string {
-  const { args } = inputs
-  if (args.branch) {
-    return args.branch
+  const { args, environment: envs } = inputs
+  const branch = args.branch || envs.GIT_BRANCH || envs.BRANCH_NAME || ''
+  if (branch !== '') {
+    return branch
   }
   try {
     const branchName = runExternalProgram('git', ['rev-parse', '--abbrev-ref', 'HEAD'])
@@ -51,9 +52,10 @@ export function getServiceName(): string {
 }
 
 function _getSHA(inputs: UploaderInputs) {
-  const { args } = inputs
-  if (args.sha) {
-    return args.sha
+  const { args, environment: envs } = inputs
+  const sha = args.sha || envs.GIT_COMMIT || ''
+  if (sha !== '') {
+    return sha
   }
   try {
     const sha = runExternalProgram('git', ['rev-parse', 'HEAD'])
@@ -90,5 +92,10 @@ export function getServiceParams(inputs: UploaderInputs): IServiceParams {
 }
 
 export function getEnvVarNames(): string[] {
-  return ['CI']
+  return [
+    'BRANCH_NAME',
+    'CI',
+    'GIT_BRANCH',
+    'GIT_COMMIT',
+  ]
 }


Test patch:
diff --git a/test/providers/provider_local.test.ts b/test/providers/provider_local.test.ts
index 4e2ef03..0fd8a01 100644
--- a/test/providers/provider_local.test.ts
+++ b/test/providers/provider_local.test.ts
@@ -53,6 +53,34 @@ describe('Local Params', () => {
     expect(params).toMatchObject(expected)
   })
 
+  it('returns on override args + env vars', () => {
+    const inputs: UploaderInputs = {
+      args: {
+        ...createEmptyArgs(),
+        ...{
+          pr: '1',
+          slug: 'owner/repo',
+        },
+      },
+      environment: {
+        GIT_COMMIT: 'testingsha',
+        GIT_BRANCH: 'main'
+      },
+    }
+    const expected: IServiceParams = {
+      branch: 'main',
+      build: '',
+      buildURL: '',
+      commit: 'testingsha',
+      job: '',
+      pr: '1',
+      service: '',
+      slug: 'owner/repo',
+    }
+    const params = providerLocal.getServiceParams(inputs)
+    expect(params).toMatchObject(expected)
+  })
+
   it('returns errors on git command failures', () => {
     const inputs: UploaderInputs = {
       args: { ...createEmptyArgs() },
Repository: klothoplatform/klotho
Pull request #822 (2023-12-12 22:57:09)

dont check validity if theres already an edge
updates matcher to not have a default since it cant have a default for tcp

only run edge validity checks if theres no existing edge

### Standard checks

- **Unit tests**: Any special considerations?
- **Docs**: Do we need to update any docs, internal or public?
- **Backwards compatibility**: Will this break existing apps? If so, what would be the extra work required to keep them working?



Patch:
diff --git a/pkg/engine2/path_selection/path_expansion.go b/pkg/engine2/path_selection/path_expansion.go
index 941a5946..f20cbda8 100644
--- a/pkg/engine2/path_selection/path_expansion.go
+++ b/pkg/engine2/path_selection/path_expansion.go
@@ -437,11 +437,19 @@ func expandPath(
 			return
 		}
 
-		valid, err := checkUniquenessValidity(ctx, source.id, target.id)
-		if err != nil {
+		// if the edge doesnt exist in the actual graph we need to check uniqueness validity
+		_, err := ctx.RawView().Edge(source.id, target.id)
+		if errors.Is(err, graph.ErrEdgeNotFound) {
+			valid, err := checkUniquenessValidity(ctx, source.id, target.id)
+			if err != nil {
+				errs = errors.Join(errs, err)
+				return
+			}
+			if !valid {
+				return
+			}
+		} else if err != nil {
 			errs = errors.Join(errs, err)
-		}
-		if !valid {
 			return
 		}
 
diff --git a/pkg/templates/aws/resources/target_group.yaml b/pkg/templates/aws/resources/target_group.yaml
index b152b6ee..2c8ef474 100644
--- a/pkg/templates/aws/resources/target_group.yaml
+++ b/pkg/templates/aws/resources/target_group.yaml
@@ -59,7 +59,6 @@ properties:
         default_value: 2
       Matcher:
         type: string
-        default_value: 200-299
   Arn:
     type: string
     configuration_disabled: true


Test patch:
diff --git a/pkg/engine2/testdata/k8s_api.expect.yaml b/pkg/engine2/testdata/k8s_api.expect.yaml
index 1c2ec5fb..e4e53ed8 100755
--- a/pkg/engine2/testdata/k8s_api.expect.yaml
+++ b/pkg/engine2/testdata/k8s_api.expect.yaml
@@ -135,7 +135,6 @@ resources:
             Enabled: true
             HealthyThreshold: 5
             Interval: 30
-            Matcher: 200-299
             Protocol: TCP
             Timeout: 5
             UnhealthyThreshold: 2
Repository: klothoplatform/klotho
Pull request #907 (2024-01-29 19:47:55)

Mark stage -> deployment direct only so path selection can't use that to bypass rest_api
Fixes https://github.com/klothoplatform/klotho/issues/868

Repro input for ^
```yaml
constraints:
  - node: aws:cloudfront_distribution:cloudfront_distribution_2
    operator: add
    scope: application
  - node: aws:load_balancer:load-balancer-8
    operator: add
    scope: application
  - operator: must_exist
    scope: edge
    target:
      source: aws:cloudfront_distribution:cloudfront_distribution_2
      target: aws:load_balancer:load-balancer-8
```

Now fails with `could not find shortest path between aws:cloudfront_distribution:cloudfront_distribution_2 and aws:load_balancer:load-balancer-8: target vertex not reachable from source`


Patch:
diff --git a/pkg/templates/aws/edges/api_stage-api_deployment.yaml b/pkg/templates/aws/edges/api_stage-api_deployment.yaml
index 24e457d9..9f6f0c3b 100644
--- a/pkg/templates/aws/edges/api_stage-api_deployment.yaml
+++ b/pkg/templates/aws/edges/api_stage-api_deployment.yaml
@@ -1,2 +1,3 @@
 source: aws:api_stage
 target: aws:api_deployment
+direct_edge_only: true
diff --git a/pkg/templates/aws/resources/ecs_task_definition.yaml b/pkg/templates/aws/resources/ecs_task_definition.yaml
index f37c117d..63d8ee90 100644
--- a/pkg/templates/aws/resources/ecs_task_definition.yaml
+++ b/pkg/templates/aws/resources/ecs_task_definition.yaml
@@ -42,6 +42,7 @@ properties:
         description: The entry point that is passed to the container
       Environment:
         type: list
+        important: true
         properties:
           Name:
             type: string


Test patch:
diff --git a/pkg/engine2/testdata/cf_distribution.dataflow-viz.yaml b/pkg/engine2/testdata/cf_distribution.dataflow-viz.yaml
index 74c3230a..1ac5bbe9 100755
--- a/pkg/engine2/testdata/cf_distribution.dataflow-viz.yaml
+++ b/pkg/engine2/testdata/cf_distribution.dataflow-viz.yaml
@@ -14,7 +14,6 @@ resources:
 
   cloudfront_distribution/cloudfront_distribution_2 -> rest_api/rest_api_1:
     path:
-        - aws:api_deployment:rest_api_1:api_deployment-0
         - aws:api_stage:rest_api_1:cloudfront_distribution_2-rest_api_1
 
   cloudfront_distribution/cloudfront_distribution_2 -> s3_bucket/s3-bucket-3: