nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: osbuild/osbuild-composer
Pull request #166 (2019-12-12 17:36:23)

weldr: return version as string from api/status
This is what lorax-composer does and composer-cli expects.


Patch:
diff --git a/internal/distro/rhel82/distro.go b/internal/distro/rhel82/distro.go
index d01112c0c..b1f91f909 100644
--- a/internal/distro/rhel82/distro.go
+++ b/internal/distro/rhel82/distro.go
@@ -179,17 +179,21 @@ func New() *RHEL82 {
 		Name:     "image.qcow2",
 		MimeType: "application/x-qemu-disk",
 		Packages: []string{
+			// Defaults
 			"@Core",
-			"chrony",
-			"kernel",
-			"selinux-policy-targeted",
 			"grub2-pc",
-			"spice-vdagent",
-			"qemu-guest-agent",
-			"xen-libs",
 			"langpacks-en",
+
+			// Don't run dracut in host-only mode, in order to pull in
+			// the hv_vmbus, hv_netvsc and hv_storvsc modules into the initrd.
+			"dracut-config-generic",
+
+			// From the lorax kickstart
+			"kernel",
+			"selinux-policy-targeted",
 			"cloud-init",
-			"libdrm",
+			"qemu-guest-agent",
+			"spice-vdagent",
 		},
 		ExcludedPackages: []string{
 			"dracut-config-rescue",
diff --git a/internal/weldr/api.go b/internal/weldr/api.go
index d9034269d..1b203a3d0 100644
--- a/internal/weldr/api.go
+++ b/internal/weldr/api.go
@@ -198,7 +198,7 @@ func statusResponseError(writer http.ResponseWriter, code int, errors ...respons
 
 func (api *API) statusHandler(writer http.ResponseWriter, request *http.Request, _ httprouter.Params) {
 	type reply struct {
-		API           uint     `json:"api"`
+		API           string   `json:"api"`
 		DBSupported   bool     `json:"db_supported"`
 		DBVersion     string   `json:"db_version"`
 		SchemaVersion string   `json:"schema_version"`
@@ -208,7 +208,7 @@ func (api *API) statusHandler(writer http.ResponseWriter, request *http.Request,
 	}
 
 	json.NewEncoder(writer).Encode(reply{
-		API:           1,
+		API:           "1",
 		DBSupported:   true,
 		DBVersion:     "0",
 		SchemaVersion: "0",


Test patch:
diff --git a/internal/weldr/api_test.go b/internal/weldr/api_test.go
index 89a41a169..99c784d81 100644
--- a/internal/weldr/api_test.go
+++ b/internal/weldr/api_test.go
@@ -40,7 +40,7 @@ func TestBasic(t *testing.T) {
 		ExpectedStatus int
 		ExpectedJSON   string
 	}{
-		{"/api/status", http.StatusOK, `{"api":1,"db_supported":true,"db_version":"0","schema_version":"0","backend":"osbuild-composer","build":"devel","messages":[]}`},
+		{"/api/status", http.StatusOK, `{"api":"1","db_supported":true,"db_version":"0","schema_version":"0","backend":"osbuild-composer","build":"devel","messages":[]}`},
 
 		{"/api/v0/projects/source/list", http.StatusOK, `{"sources":["test"]}`},