PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: scala-steward-org/scala-steward (scala)

Issue:
Prevent updates from RC to NIGHTLY version
See https://github.com/stryker-mutator/stryker4s/pull/612. I think this can be achieved by adding `NIGHTLY` to this [match](https://github.com/scala-steward-org/scala-steward/blob/41eb40b2fbc11ddd3e6e1548e038ae919defa259/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala#L128-L135).

Pull request:
Closes #1683.

Patch:
diff --git a/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala b/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala
index 019bde681e..d39012ed07 100644
--- a/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala
+++ b/modules/core/src/main/scala/org/scalasteward/core/data/Version.scala
@@ -126,12 +126,12 @@ object Version {
       def isPreReleaseIdent: Boolean = order < 0
       def order: Int =
         value.toUpperCase match {
-          case "SNAP" | "SNAPSHOT"      => -5
-          case "ALPHA" | "PREVIEW"      => -4
-          case "BETA" | "B"             => -3
-          case "M" | "MILESTONE" | "AM" => -2
-          case "RC"                     => -1
-          case _                        => 0
+          case "SNAP" | "SNAPSHOT" | "NIGHTLY" => -5
+          case "ALPHA" | "PREVIEW"             => -4
+          case "BETA" | "B"                    => -3
+          case "M" | "MILESTONE" | "AM"        => -2
+          case "RC"                            => -1
+          case _                               => 0
         }
     }
     final case class Separator(c: Char, startIndex: Int) extends Component


Test patch:
diff --git a/modules/core/src/test/scala/org/scalasteward/core/data/VersionTest.scala b/modules/core/src/test/scala/org/scalasteward/core/data/VersionTest.scala
index 4a7a19e6c9..9c955c3c96 100644
--- a/modules/core/src/test/scala/org/scalasteward/core/data/VersionTest.scala
+++ b/modules/core/src/test/scala/org/scalasteward/core/data/VersionTest.scala
@@ -202,7 +202,8 @@ class VersionTest
       ("0.21.0-RC5", List("0.21.6", "0.21.6+43-2c1c1172-SNAPSHOT"), Some("0.21.6")),
       ("0.21.0-RC5", List("0.21.5", "0.21.6-RC1"), Some("0.21.6-RC1")),
       ("2.1.4.0-RC17", List("2.1.4.0-RC17+1-307f2f6c-SNAPSHOT"), None),
-      ("v2-rev374-1.23.0", List("v2-rev20190917-1.30.3"), Some("v2-rev20190917-1.30.3"))
+      ("v2-rev374-1.23.0", List("v2-rev20190917-1.30.3"), Some("v2-rev20190917-1.30.3")),
+      ("0.27.0-RC1", List("0.27.0-bin-20200826-2e58a66-NIGHTLY"), None)
     )
 
     val rnd = new Random()
Repository: apache/camel-k (go)

Issue:
route trait assumes target port name is always 'http'

Pull request:
route trait assumes target port name is always 'http'
Fixes #837

Patch:
diff --git a/pkg/trait/route.go b/pkg/trait/route.go
index c3eb320c5..f761a489a 100644
--- a/pkg/trait/route.go
+++ b/pkg/trait/route.go
@@ -80,6 +80,12 @@ func (t *routeTrait) Configure(e *Environment) (bool, error) {
 }
 
 func (t *routeTrait) Apply(e *Environment) error {
+	servicePortName := httpPortName
+	dt := e.Catalog.GetTrait(containerTraitID)
+	if dt != nil {
+		servicePortName = dt.(*containerTrait).ServicePortName
+	}
+
 	route := routev1.Route{
 		TypeMeta: metav1.TypeMeta{
 			Kind:       "Route",
@@ -91,7 +97,7 @@ func (t *routeTrait) Apply(e *Environment) error {
 		},
 		Spec: routev1.RouteSpec{
 			Port: &routev1.RoutePort{
-				TargetPort: intstr.FromString("http"),
+				TargetPort: intstr.FromString(servicePortName),
 			},
 			To: routev1.RouteTargetReference{
 				Kind: "Service",


Test patch:
diff --git a/pkg/trait/route_test.go b/pkg/trait/route_test.go
index 0f81683d5..0d270fc11 100644
--- a/pkg/trait/route_test.go
+++ b/pkg/trait/route_test.go
@@ -104,6 +104,7 @@ func TestRoute_Default(t *testing.T) {
 
 	assert.Nil(t, err)
 	assert.NotEmpty(t, environment.ExecutedTraits)
+	assert.NotNil(t, environment.GetTrait(ID("container")))
 	assert.NotNil(t, environment.GetTrait(ID("route")))
 
 	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
@@ -112,6 +113,8 @@ func TestRoute_Default(t *testing.T) {
 
 	assert.NotNil(t, route)
 	assert.Nil(t, route.Spec.TLS)
+	assert.NotNil(t, route.Spec.Port)
+	assert.Equal(t, httpPortName, route.Spec.Port.TargetPort.StrVal)
 }
 
 func TestRoute_Disabled(t *testing.T) {
@@ -166,3 +169,35 @@ func TestRoute_TLS(t *testing.T) {
 	assert.NotNil(t, route.Spec.TLS)
 	assert.Equal(t, routev1.TLSTerminationEdge, route.Spec.TLS.Termination)
 }
+
+func TestRoute_WithCustomServicePort(t *testing.T) {
+	name := xid.New().String()
+	environment := createTestRouteEnvironment(t, name)
+	environment.Integration.Spec.Traits = map[string]v1alpha1.TraitSpec{
+		containerTraitID: {
+			Configuration: map[string]string{
+				"service-port-name": "my-port",
+			},
+		},
+	}
+
+	traitsCatalog := environment.Catalog
+	err := traitsCatalog.apply(environment)
+
+	assert.Nil(t, err)
+	assert.NotEmpty(t, environment.ExecutedTraits)
+	assert.NotNil(t, environment.GetTrait(ID("container")))
+	assert.NotNil(t, environment.GetTrait(ID("route")))
+
+	route := environment.Resources.GetRoute(func(r *routev1.Route) bool {
+		return r.ObjectMeta.Name == name
+	})
+
+	assert.NotNil(t, route)
+	assert.NotNil(t, route.Spec.Port)
+	assert.Equal(
+		t,
+		environment.Integration.Spec.Traits[containerTraitID].Configuration["service-port-name"],
+		route.Spec.Port.TargetPort.StrVal,
+	)
+}