nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: serverlessworkflow/sdk-java
Pull request #284 (2023-10-27 15:49:53)

Force id to be mandatory
**Many thanks for submitting your Pull Request :heart:!**

**What this PR does / why we need it**:
This makes id mandatory, keeping current constructor unchanged from the previous version

**Special notes for reviewers**:

**Additional information (if needed):**
SDK has currently two misaligments with the spec: id and name are mandatory, while the former is mandatory only if there is no key and the latter is optional. Since making id optionally depending on key is not a good idea that will be probably changed in 0.9 (where ID will be mandatory always and key removed or make optional), I think is better to postpone the API breaking change to the migration to 0.9


Patch:
diff --git a/api/src/main/resources/schema/workflow.json b/api/src/main/resources/schema/workflow.json
index 1c106c1..aa53061 100644
--- a/api/src/main/resources/schema/workflow.json
+++ b/api/src/main/resources/schema/workflow.json
@@ -161,6 +161,7 @@
     }
   },
  "required": [
+        "id",
         "name",
         "version",
         "states"


Test patch:
diff --git a/validation/src/test/java/io/serverlessworkflow/validation/test/WorkflowValidationTest.java b/validation/src/test/java/io/serverlessworkflow/validation/test/WorkflowValidationTest.java
index e600e25..0823752 100644
--- a/validation/src/test/java/io/serverlessworkflow/validation/test/WorkflowValidationTest.java
+++ b/validation/src/test/java/io/serverlessworkflow/validation/test/WorkflowValidationTest.java
@@ -58,7 +58,7 @@ public class WorkflowValidationTest {
     List<ValidationError> validationErrors =
         workflowValidator.setSource("---\n" + "key: abc\n").validate();
     Assertions.assertNotNull(validationErrors);
-    Assertions.assertEquals(3, validationErrors.size());
+    Assertions.assertEquals(4, validationErrors.size());
   }
 
   @Test
@@ -119,11 +119,10 @@ public class WorkflowValidationTest {
                     + "}")
             .validate();
     Assertions.assertNotNull(validationErrors);
-    Assertions.assertEquals(2, validationErrors.size());
+    Assertions.assertEquals(1, validationErrors.size());
 
     Assertions.assertEquals(
-        "Workflow id or key should not be empty", validationErrors.get(0).getMessage());
-    Assertions.assertEquals("No states found", validationErrors.get(1).getMessage());
+        "$.id: is missing but it is required", validationErrors.get(0).getMessage());
   }
 
   @Test
Repository: sharkdp/bat
Pull request #3168 (2025-01-07 21:43:24)

Fix name of BAT_THEME_{DARK,LIGHT} env vars
*this is a bit embarrassing since I'm the person who wrote the code in the first place 😆*

keith-hall: Probably we should add a changelog entry, in case we want to push a bugfix release for it? 🙂
keith-hall: Would it be worth trying to add an integration test to prove these env vars work as expected or not really possible?

Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 08113db1..941e4e3c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,7 @@
 ## Features
 
 ## Bugfixes
+* Fix `BAT_THEME_DARK` and `BAT_THEME_LIGHT` being ignored, see issue #3171 and PR #3168 (@bash)
 
 ## Other
 
diff --git a/src/theme.rs b/src/theme.rs
index 5863bf85..11352183 100644
--- a/src/theme.rs
+++ b/src/theme.rs
@@ -10,9 +10,9 @@ pub mod env {
     /// See [`crate::theme::ThemeOptions::theme`].
     pub const BAT_THEME: &str = "BAT_THEME";
     /// See [`crate::theme::ThemeOptions::theme_dark`].
-    pub const BAT_THEME_DARK: &str = "BAT_THEME";
+    pub const BAT_THEME_DARK: &str = "BAT_THEME_DARK";
     /// See [`crate::theme::ThemeOptions::theme_light`].
-    pub const BAT_THEME_LIGHT: &str = "BAT_THEME";
+    pub const BAT_THEME_LIGHT: &str = "BAT_THEME_LIGHT";
 }
 
 /// Chooses an appropriate theme or falls back to a default theme


Test patch:
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs
index 8b61b878..b4680a1e 100644
--- a/tests/integration_tests.rs
+++ b/tests/integration_tests.rs
@@ -2265,6 +2265,46 @@ fn theme_arg_overrides_env_withconfig() {
         .stderr("");
 }
 
+#[test]
+fn theme_light_env_var_is_respected() {
+    bat()
+        .env("BAT_THEME_LIGHT", "Coldark-Cold")
+        .env("COLORTERM", "truecolor")
+        .arg("--theme=light")
+        .arg("--paging=never")
+        .arg("--color=never")
+        .arg("--terminal-width=80")
+        .arg("--wrap=never")
+        .arg("--decorations=always")
+        .arg("--style=plain")
+        .arg("--highlight-line=1")
+        .write_stdin("Lorem Ipsum")
+        .assert()
+        .success()
+        .stdout("\x1B[48;2;208;218;231mLorem Ipsum\x1B[0m")
+        .stderr("");
+}
+
+#[test]
+fn theme_dark_env_var_is_respected() {
+    bat()
+        .env("BAT_THEME_DARK", "Coldark-Dark")
+        .env("COLORTERM", "truecolor")
+        .arg("--theme=dark")
+        .arg("--paging=never")
+        .arg("--color=never")
+        .arg("--terminal-width=80")
+        .arg("--wrap=never")
+        .arg("--decorations=always")
+        .arg("--style=plain")
+        .arg("--highlight-line=1")
+        .write_stdin("Lorem Ipsum")
+        .assert()
+        .success()
+        .stdout("\x1B[48;2;33;48;67mLorem Ipsum\x1B[0m")
+        .stderr("");
+}
+
 #[test]
 fn theme_env_overrides_config() {
     bat_with_config()