nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: iterative/cml
Pull request #591 (2021-06-15 09:42:36)

Hotfix Expose terraform aws_security_group param
Some users need to specify a different VPC. This can be done for AWS in our TPI via aws_security_group.
Example of usage:

```sh
cml-runner \
--cloud aws  \   
--cloud-region eu-west-2 \    
--cloud-type t2.micro  \  
--labels cml-test \
--cloud-aws-security-group launch-wizard-1
```


Patch:
diff --git a/bin/cml-runner.js b/bin/cml-runner.js
index a201335..55bc282 100755
--- a/bin/cml-runner.js
+++ b/bin/cml-runner.js
@@ -134,6 +134,7 @@ const runCloud = async (opts) => {
       cloudSpot: spot,
       cloudSpotPrice: spotPrice,
       cloudStartupScript: startupScript,
+      cloudAwsSecurityGroup: awsSecurityGroup,
       tfFile,
       workdir
     } = opts;
@@ -165,7 +166,8 @@ const runCloud = async (opts) => {
         sshPrivate,
         spot,
         spotPrice,
-        startupScript
+        startupScript,
+        awsSecurityGroup
       });
     }
 
@@ -394,6 +396,8 @@ const opts = yargs
     'cloud-startup-script',
     'Run the provided Base64-encoded Linux shell script during the instance initialization'
   )
+  .default('cloud-aws-security-group', '')
+  .describe('cloud-aws-security-group', 'Specifies the security group in AWS')
   .default('tf-resource')
   .hide('tf-resource')
   .alias('tf-resource', 'tf_resource')
diff --git a/src/terraform.js b/src/terraform.js
index 92c4a5a..38ad58a 100644
--- a/src/terraform.js
+++ b/src/terraform.js
@@ -79,7 +79,8 @@ const iterativeCmlRunnerTpl = (opts = {}) => {
     sshPrivate,
     spot,
     spotPrice,
-    startupScript
+    startupScript,
+    awsSecurityGroup
   } = opts;
 
   return `
@@ -106,6 +107,7 @@ resource "iterative_cml_runner" "runner" {
   ${spot ? `spot = ${spot}` : ''}
   ${spotPrice ? `spot_price = ${spotPrice}` : ''}
   ${startupScript ? `startup_script = "${startupScript}"` : ''}
+  ${awsSecurityGroup ? `aws_security_group = "${awsSecurityGroup}"` : ''}
 }
 `;
 };


Test patch:
diff --git a/src/terraform.test.js b/src/terraform.test.js
index 52dfadc..9a6f5c9 100644
--- a/src/terraform.test.js
+++ b/src/terraform.test.js
@@ -34,6 +34,7 @@ describe('Terraform tests', () => {
         
         
         
+        
       }
       "
     `);
@@ -55,7 +56,8 @@ describe('Terraform tests', () => {
       hddSize: 50,
       sshPrivate: 'myprivate',
       spot: true,
-      spotPrice: '0.0001'
+      spotPrice: '0.0001',
+      awsSecurityGroup: 'mysg'
     });
     expect(output).toMatchInlineSnapshot(`
       "
@@ -88,6 +90,7 @@ describe('Terraform tests', () => {
         spot = true
         spot_price = 0.0001
         
+        aws_security_group = \\"mysg\\"
       }
       "
     `);
@@ -142,6 +145,7 @@ describe('Terraform tests', () => {
         spot = true
         spot_price = 0.0001
         
+        
       }
       "
     `);
@@ -197,6 +201,7 @@ describe('Terraform tests', () => {
         spot = true
         spot_price = 0.0001
         startup_script = \\"c3VkbyBlY2hvICdoZWxsbyB3b3JsZCcgPj4gL3Vzci9oZWxsby50eHQ=\\"
+        
       }
       "
     `);
Repository: iterative/cml
Pull request #967 (2022-04-16 09:06:55)

Hide `cml runner --tpi-version`
* https://github.com/iterative/cml/pull/885#pullrequestreview-943840022

0x2b3bfa0: > _beats documenting `--flag<SPACE>=<THING>`_ 

Do you mean `--flag="<THING><SPACE>"` as per https://github.com/iterative/cml/issues/852#issuecomment-1083125843? 😅 
casperdcl: No I mean [equally bad](https://github.com/iterative/cml/pull/885#issuecomment-1098502722)

Patch:
diff --git a/bin/cml/runner.js b/bin/cml/runner.js
index db2420a..5798924 100755
--- a/bin/cml/runner.js
+++ b/bin/cml/runner.js
@@ -443,7 +443,8 @@ exports.builder = (yargs) =>
         type: 'string',
         default: '>= 0.9.10',
         description:
-          'Pin the iterative/iterative terraform provider to a specific version. i.e. "= 0.10.4" See: https://www.terraform.io/language/expressions/version-constraints'
+          'Pin the iterative/iterative terraform provider to a specific version. i.e. "= 0.10.4" See: https://www.terraform.io/language/expressions/version-constraints',
+        hidden: true
       },
       dockerVolumes: {
         type: 'array',


Test patch:
diff --git a/bin/cml/runner.test.js b/bin/cml/runner.test.js
index 739faaa..f0d05e5 100644
--- a/bin/cml/runner.test.js
+++ b/bin/cml/runner.test.js
@@ -63,12 +63,6 @@ describe('CML e2e', () => {
         --version                                 Show version number        [boolean]
         --log                                     Maximum log level
                 [string] [choices: \\"error\\", \\"warn\\", \\"info\\", \\"debug\\"] [default: \\"info\\"]
-        --tpi-version                             Pin the iterative/iterative
-                                                  terraform provider to a specific
-                                                  version. i.e. \\"= 0.10.4\\" See:
-                                                  https://www.terraform.io/language/ex
-                                                  pressions/version-constraints
-                                                       [string] [default: \\">= 0.9.10\\"]
         --docker-volumes                          Docker volumes. This feature is only
                                                   supported in GitLab
                                                                  [array] [default: []]
Repository: iterative/cml
Pull request #1166 (2022-09-13 22:32:48)

Add support for `cml comment <verb> --publish-url`
Required for https://github.com/iterative/cml.dev/issues/316
```
cml comment <create|update> --publish --publish-url=https://{identifier}.lambda-url.{region}.on.aws
```


Patch:
diff --git a/bin/cml/comment/create.js b/bin/cml/comment/create.js
index ff6bb15..59ea2a6 100644
--- a/bin/cml/comment/create.js
+++ b/bin/cml/comment/create.js
@@ -26,6 +26,11 @@ exports.options = kebabcaseKeys({
     type: 'boolean',
     description: 'Upload any local images found in the Markdown report'
   },
+  publishUrl: {
+    type: 'string',
+    default: 'https://asset.cml.dev',
+    description: 'Self-hosted image server URL'
+  },
   watch: {
     type: 'boolean',
     description: 'Watch for changes and automatically update the comment'
diff --git a/src/cml.js b/src/cml.js
index 505c1d7..8a755e2 100755
--- a/src/cml.js
+++ b/src/cml.js
@@ -167,6 +167,7 @@ class CML {
       update,
       pr,
       publish,
+      publishUrl,
       markdownFile,
       report: testReport,
       watch,
@@ -208,7 +209,11 @@ class CML {
           );
           if (!triggerFile && watch) watcher.add(absolutePath);
           try {
-            node.url = await this.publish({ ...opts, path: absolutePath });
+            node.url = await this.publish({
+              ...opts,
+              path: absolutePath,
+              url: publishUrl
+            });
           } catch (err) {
             if (err.code !== 'ENOENT') throw err;
           }


Test patch:
diff --git a/bin/cml/comment/create.test.js b/bin/cml/comment/create.test.js
index 8ed29a3..feb06e9 100644
--- a/bin/cml/comment/create.test.js
+++ b/bin/cml/comment/create.test.js
@@ -33,6 +33,8 @@ describe('Comment integration tests', () => {
                                                             [string] [default: \\"HEAD\\"]
         --publish                 Upload any local images found in the Markdown report
                                                                              [boolean]
+        --publish-url             Self-hosted image server URL
+                                           [string] [default: \\"https://asset.cml.dev\\"]
         --watch                   Watch for changes and automatically update the
                                   comment                                    [boolean]
         --native                  Uses driver's native capabilities to upload assets
@@ -64,4 +66,11 @@ describe('Comment integration tests', () => {
     await fs.writeFile(path, report);
     await exec(`node ./bin/cml.js send-comment ${path}`);
   });
+
+  test('cml send-comment --publish to current repo', async () => {
+    const report = `## Test Comment\n![](assets/logo.png)`;
+
+    await fs.writeFile(path, report);
+    await exec(`node ./bin/cml.js send-comment --publish ${path}`);
+  });
 });
Repository: iterative/cml
Pull request #1208 (2022-10-06 16:17:22)

Enable `cml comment create --publish` by default
Behavior only changes for local Markdown links

dacbd: do we only publish if the file isn't in git, ie you can reference local files that are in your git repo in markdown for links too and they will be rendered(without using `--publish`) right?
0x2b3bfa0: After this change, any local file referenced from the Markdown document will be automatically uploaded

Patch:
diff --git a/bin/cml/comment/create.js b/bin/cml/comment/create.js
index 59ea2a6..8036dca 100644
--- a/bin/cml/comment/create.js
+++ b/bin/cml/comment/create.js
@@ -24,6 +24,7 @@ exports.options = kebabcaseKeys({
   },
   publish: {
     type: 'boolean',
+    default: true,
     description: 'Upload any local images found in the Markdown report'
   },
   publishUrl: {


Test patch:
diff --git a/bin/cml/comment/create.test.js b/bin/cml/comment/create.test.js
index a7a8a28..e9245a4 100644
--- a/bin/cml/comment/create.test.js
+++ b/bin/cml/comment/create.test.js
@@ -23,7 +23,7 @@ describe('Comment integration tests', () => {
         --commit-sha, --head-sha  Commit SHA linked to this comment
                                                             [string] [default: \\"HEAD\\"]
         --publish                 Upload any local images found in the Markdown report
-                                                                             [boolean]
+                                                             [boolean] [default: true]
         --publish-url             Self-hosted image server URL
                                            [string] [default: \\"https://asset.cml.dev\\"]
         --watch                   Watch for changes and automatically update the