PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: nvim-lua/plenary.nvim (lua)

Issue:
job on_stdout is not retrieving all data
Hi and thanks for this awesome project!

I have been using the `plenary.curl` module recently, especially it's capability to stream http responses using the underlying `plenary.job` `on_stdout` mechanism.

While using it, I discovered a few weired edge-cases where the last chunks of streamed data is only available via `job:result()`, but not the `on_stdout` callback.

Looking at the tests I found [two related test cases that are marked as `pending`](https://github.com/nvim-lua/plenary.nvim/blob/master/tests/plenary/job_spec.lua#L102), so it seems like this has been a known issue.

As this is unnecessarily complicating my usage of the `plenary.curl` streaming functionality, as I would have to use both `on_stdout` and then at the end compare what has not yet been processed from the `job:result()`, I would like to resolve this bug.

Please let me know if I have misunderstood anything or you have further thoughts.
I will open a PR with a potential solution.

Thanks a lot!

Pull request:
The current condition prematurely quits processing of data in on_output
in some edge-cases.

In these cases `job:result()` will have all data, but not everyting was
sent through the `on_output` pipes.

Closes https://github.com/nvim-lua/plenary.nvim/issues/634

Thanks for your support, please let me know your thoughts!

Patch:
diff --git a/lua/plenary/job.lua b/lua/plenary/job.lua
index 44a73483..7f549719 100644
--- a/lua/plenary/job.lua
+++ b/lua/plenary/job.lua
@@ -361,7 +361,7 @@ local on_output = function(self, result_key, cb)
         cb(err, result_line, self)
       end
 
-      if data == nil or is_complete then
+      if is_complete then
         return
       end
 


Test patch:
diff --git a/tests/plenary/job_spec.lua b/tests/plenary/job_spec.lua
index d9213be3..c2edde04 100644
--- a/tests/plenary/job_spec.lua
+++ b/tests/plenary/job_spec.lua
@@ -99,7 +99,7 @@ describe("Job", function()
       assert.are.same(job:result(), results)
     end)
 
-    pending("should split stdin across newlines with no ending newline", function()
+    it("should split stdin across newlines with no ending newline", function()
       local results = {}
       local job = Job:new {
         -- writer = "hello\nword\nthis is\ntj",
@@ -113,6 +113,8 @@ describe("Job", function()
       job:start()
       job:send "hello\nwor"
       job:send "ld"
+
+      wait_for_result(job, { "hello", "world" })
       job:shutdown()
 
       assert.are.same(job:result(), { "hello", "world" })
@@ -137,7 +139,7 @@ describe("Job", function()
       assert.are.same(job:result(), results)
     end)
 
-    pending("should return last line when there is no ending newline", function()
+    it("should return last line when there is no ending newline", function()
       local results = {}
       local job = Job:new {
         command = "printf",
Repository: 11ty/eleventy (js)

Issue:
Deduplicate tags after merging
**Is your feature request related to a problem? Please describe.**
When I'm generating a collection on my site, I sometimes use data merging to provide tags common to the series and then tag individual posts further. If I happen to forget that I already have a tag for a given collection, I end up with duplicate tags. This isn't terrible, but it can easily mean that I have duplicates in the JSON Feed I generate.

**Describe the solution you'd like**
Tags (and indeed data in general) should be deduplicated; at a minimum it should be *possible* to deduplicate.

**Describe alternatives you've considered**
- Just keep manually making sure to avoid duplicates
- Deduplicate manually anywhere the collection is used

**Additional context**
N/A


Pull request:
Deduplicate tags when using deepDataMerge
Resolves #1810.

As described in #1810, tags can be duplicated through a data deep merge if they appear in more than one place.

I can't think of a reason why anyone needs a tag to appear more than once within the data cascade, so this uses `new Set` to deduplicate the output.

Hopefully this is OK!

Patch:
diff --git a/src/TemplateData.js b/src/TemplateData.js
index bf90503d..92eeaa14 100755
--- a/src/TemplateData.js
+++ b/src/TemplateData.js
@@ -586,6 +586,9 @@ class TemplateData {
       } else if (data.tags === null) {
         data.tags = [];
       }
+
+      // Deduplicate tags
+      data.tags = [...new Set(data.tags)];
     }
 
     return data;


Test patch:
diff --git a/test/TemplateTest.js b/test/TemplateTest.js
index 8c590884..dd92d6fc 100644
--- a/test/TemplateTest.js
+++ b/test/TemplateTest.js
@@ -1489,6 +1489,26 @@ test("Data Cascade Tag Merge (Deep merge)", async (t) => {
   t.deepEqual(data.tags.sort(), ["tagA", "tagB", "tagC", "tagD"]);
 });
 
+test("Data Cascade Tag Merge (Deep Merge - Deduplication)", async (t) => {
+  let eleventyConfig = new TemplateConfig();
+  // Default changed in 1.0
+  // eleventyConfig.userConfig.setDataDeepMerge(true);
+  let dataObj = new TemplateData("./test/stubs/", eleventyConfig);
+  await dataObj.cacheData();
+
+  let tmpl = getNewTemplate(
+    "./test/stubs/data-cascade/template.njk",
+    "./test/stubs/",
+    "./dist",
+    dataObj,
+    null,
+    eleventyConfig
+  );
+
+  let data = await tmpl.getData();
+  t.deepEqual(data.tags.sort(), ["tagA", "tagB", "tagC", "tagD"]);
+});
+
 test("Data Cascade Tag Merge (Shallow merge)", async (t) => {
   let eleventyConfig = new TemplateConfig();
   // Default changed in 1.0
diff --git a/test/stubs/data-cascade/template.11tydata.js b/test/stubs/data-cascade/template.11tydata.js
index c28b80b7..d78ea3ab 100644
--- a/test/stubs/data-cascade/template.11tydata.js
+++ b/test/stubs/data-cascade/template.11tydata.js
@@ -1,8 +1,8 @@
 module.exports = {
   parent: {
     child: 2,
-    datafile: true
+    datafile: true,
   },
   datafile: true,
-  tags: ["tagC", "tagD"]
+  tags: ["tagC", "tagD", "tagD"],
 };
Repository: mercurius-js/mercurius (js)

Issue:
Better error messages on passing array of executable schemas.
In Mercurius' schema option, we can pass schemas as either a string or an executable schema. 

If we pass them as a string, we can also pass an array of schemas in the string type, in which case Mercurius will merge them. 

However, if we pass them as an executable schema, we can only pass one. 
Currently, there is no check to prevent the passing of an array of executable schemas. 
If we pass two executable schemas, we get an error.

Possible solutions:

- improve error handling
- use schema stitching against the executable schemas to get just one executable schema

https://github.com/mercurius-js/mercurius/blob/b6ac05724b7715ba90d8686aa8218fc8de10ffd1/index.js#L148-L171

Pull request:
schema option: Better error handling when providing arrays with non-string schemas
closes #984 

Patch:
diff --git a/index.js b/index.js
index 171b7fa..d97b454 100644
--- a/index.js
+++ b/index.js
@@ -148,6 +148,10 @@ const plugin = fp(async function (app, opts) {
   let schema = opts.schema
 
   if (Array.isArray(schema)) {
+    if (schema.some(s => typeof s !== 'string')) {
+      throw new MER_ERR_INVALID_OPTS('when providing an array to the "schema" option, only string schemas are allowed')
+    }
+
     schema = schema.join('\n')
   }
 


Test patch:
diff --git a/test/app-decorator.js b/test/app-decorator.js
index dded089..4c0f146 100644
--- a/test/app-decorator.js
+++ b/test/app-decorator.js
@@ -1075,6 +1075,29 @@ test('extended Schema is an object', async t => {
   await app.ready()
 })
 
+test('array of schemas contains a non-string schema', async t => {
+  const app = Fastify()
+
+  app.register(GQL, {
+    schema: [makeExecutableSchema({
+      typeDefs: `
+          type Query {
+            add(x: Int, y: Int): Int
+          }
+        `,
+      resolvers: {
+        Query: {
+          add: async (_, { x, y }) => x + y
+        }
+      }
+    })]
+  })
+
+  await t.rejects(app.ready(), {
+    message: 'Invalid options: when providing an array to the "schema" option, only string schemas are allowed'
+  })
+})
+
 test('Error in schema', async (t) => {
   const schema = `
     interface Event {