nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: vmware-tanzu/octant
Pull request #570 (2020-01-24 16:25:30)

Add status column to pod conditions
Signed-off-by: bryanl <bryanliles@gmail.com>

Closes: #569 


Patch:
diff --git a/changelogs/unreleased/569-bryanl b/changelogs/unreleased/569-bryanl
new file mode 100644
index 00000000..947ebe30
--- /dev/null
+++ b/changelogs/unreleased/569-bryanl
@@ -0,0 +1,1 @@
+Add status column to pod conditions
diff --git a/internal/printer/pod.go b/internal/printer/pod.go
index 195e1a41..2326f54f 100644
--- a/internal/printer/pod.go
+++ b/internal/printer/pod.go
@@ -535,18 +535,22 @@ func createMountedPodListView(ctx context.Context, namespace string, persistentV
 	return PodListHandler(ctx, mountedPodList, options)
 }
 
+var (
+	podConditionsColumns = component.NewTableCols("Type", "Status", "Last Transition Time", "Message", "Reason")
+)
+
 func createPodConditionsView(pod *corev1.Pod) (*component.Table, error) {
 	if pod == nil {
 		return nil, errors.New("pod is nil")
 	}
 
-	cols := component.NewTableCols("Type", "Last Transition Time", "Message", "Reason")
-	table := component.NewTable("Pod Conditions", "There are no pod conditions!", cols)
+	table := component.NewTable("Pod Conditions", "There are no pod conditions!", podConditionsColumns)
 
 	for _, condition := range pod.Status.Conditions {
 		row := component.TableRow{}
 
 		row["Type"] = component.NewText(string(condition.Type))
+		row["Status"] = component.NewText(string(condition.Status))
 		row["Last Transition Time"] = component.NewTimestamp(condition.LastTransitionTime.Time)
 		row["Message"] = component.NewText(condition.Message)
 		row["Reason"] = component.NewText(condition.Reason)


Test patch:
diff --git a/internal/printer/pod_test.go b/internal/printer/pod_test.go
index 2d6d9224..8d91aff0 100644
--- a/internal/printer/pod_test.go
+++ b/internal/printer/pod_test.go
@@ -345,6 +345,7 @@ func Test_createPodConditionsView(t *testing.T) {
 	pod.Status.Conditions = []corev1.PodCondition{
 		{
 			Type:               corev1.PodInitialized,
+			Status:             corev1.ConditionTrue,
 			LastTransitionTime: now,
 			Message:            "message",
 			Reason:             "reason",
@@ -354,11 +355,11 @@ func Test_createPodConditionsView(t *testing.T) {
 	got, err := createPodConditionsView(pod)
 	require.NoError(t, err)
 
-	cols := component.NewTableCols("Type", "Last Transition Time", "Message", "Reason")
-	expected := component.NewTable("Pod Conditions", "There are no pod conditions!", cols)
+	expected := component.NewTable("Pod Conditions", "There are no pod conditions!", podConditionsColumns)
 	expected.Add([]component.TableRow{
 		{
 			"Type":                 component.NewText("Initialized"),
+			"Status":               component.NewText("True"),
 			"Last Transition Time": component.NewTimestamp(now.Time),
 			"Message":              component.NewText("message"),
 			"Reason":               component.NewText("reason"),
Repository: vmware-tanzu/octant
Pull request #1240 (2020-08-11 17:39:00)

Add no-op handler for loading action
The uploader component must check if the backend is in loading state each time the component is created. This PR creates a no-op handler to prevent (`received websocket unknown message of type event.octant.dev/unknown with {message: "unknown request action.octant.dev/loading", payload: {…}}`) from spamming the console.

Signed-off-by: GuessWhoSamFoo <foos@vmware.com>


GuessWhoSamFoo: Added fix to tests breaking

Patch:
diff --git a/internal/api/content_manager.go b/internal/api/content_manager.go
index 15443143..368bf07e 100644
--- a/internal/api/content_manager.go
+++ b/internal/api/content_manager.go
@@ -188,6 +188,10 @@ func (cm *ContentManager) Handlers() []octant.ClientRequestHandler {
 			RequestType: action.RequestSetNamespace,
 			Handler:     cm.SetNamespace,
 		},
+		{
+			RequestType: CheckLoading,
+			Handler:     cm.Loaded,
+		},
 	}
 }
 
@@ -234,6 +238,11 @@ func (cm *ContentManager) SetContentPath(state octant.State, payload action.Payl
 	return nil
 }
 
+// Loaded is no-op once content is serving
+func (cm *ContentManager) Loaded(state octant.State, payload action.Payload) error {
+	return nil
+}
+
 type notFound interface {
 	NotFound() bool
 	Path() string


Test patch:
diff --git a/internal/api/content_manager_test.go b/internal/api/content_manager_test.go
index 56ebc290..6eb3354e 100644
--- a/internal/api/content_manager_test.go
+++ b/internal/api/content_manager_test.go
@@ -34,6 +34,7 @@ func TestContentManager_Handlers(t *testing.T) {
 	AssertHandlers(t, manager, []string{
 		api.RequestSetContentPath,
 		action.RequestSetNamespace,
+		api.CheckLoading,
 	})
 }
 
diff --git a/pkg/plugin/api/api_test.go b/pkg/plugin/api/api_test.go
index 73e4cf8f..94c82dc6 100644
--- a/pkg/plugin/api/api_test.go
+++ b/pkg/plugin/api/api_test.go
@@ -12,6 +12,7 @@ import (
 	"time"
 
 	"github.com/golang/mock/gomock"
+	"github.com/spf13/viper"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
 
@@ -188,6 +189,8 @@ func TestAPI(t *testing.T) {
 			controller := gomock.NewController(t)
 			defer controller.Finish()
 
+			viper.SetDefault("client-max-recv-msg-size", 1024*1024*16)
+
 			appObjectStore := storeFake.NewMockStore(controller)
 			pf := portForwardFake.NewMockPortForwarder(controller)
 			tc.initFunc(t, &apiMocks{
Repository: tetratelabs/wazero
Pull request #2324 (2024-09-27 12:07:33)

sysfs: disallow absolute symlinks
This implements this bit of the [path resolution specification](https://github.com/WebAssembly/wasi-filesystem/blob/v0.2.0/path-resolution.md#symlinks) (see #2323), and seems like a good idea regardless.


Patch:
diff --git a/internal/sysfs/dirfs_supported.go b/internal/sysfs/dirfs_supported.go
index ff93415b..a949bd54 100644
--- a/internal/sysfs/dirfs_supported.go
+++ b/internal/sysfs/dirfs_supported.go
@@ -5,6 +5,7 @@ package sysfs
 import (
 	"io/fs"
 	"os"
+	"path"
 
 	experimentalsys "github.com/tetratelabs/wazero/experimental/sys"
 )
@@ -34,6 +35,11 @@ func (d *dirFS) Chmod(path string, perm fs.FileMode) experimentalsys.Errno {
 
 // Symlink implements the same method as documented on sys.FS
 func (d *dirFS) Symlink(oldName, link string) experimentalsys.Errno {
+	// Creating a symlink with an absolute path string fails with a "not permitted" error.
+	// https://github.com/WebAssembly/wasi-filesystem/blob/v0.2.0/path-resolution.md#symlinks
+	if path.IsAbs(oldName) {
+		return experimentalsys.EPERM
+	}
 	// Note: do not resolve `oldName` relative to this dirFS. The link result is always resolved
 	// when dereference the `link` on its usage (e.g. readlink, read, etc).
 	// https://github.com/bytecodealliance/cap-std/blob/v1.0.4/cap-std/src/fs/dir.rs#L404-L409


Test patch:
diff --git a/internal/sysfs/dirfs_test.go b/internal/sysfs/dirfs_test.go
index 55e5ee10..95024cbb 100644
--- a/internal/sysfs/dirfs_test.go
+++ b/internal/sysfs/dirfs_test.go
@@ -747,6 +747,7 @@ func TestDirFS_Symlink(t *testing.T) {
 
 	testFS := DirFS(tmpDir)
 
+	require.EqualErrno(t, sys.EPERM, testFS.Symlink("/test.txt", "sub/test.txt"))
 	require.EqualErrno(t, sys.EEXIST, testFS.Symlink("sub/test.txt", "sub/test.txt"))
 	// Non-existing old name is allowed.
 	require.EqualErrno(t, 0, testFS.Symlink("non-existing", "aa"))
Repository: vitessio/vitess
Pull request #12681 (2023-03-21 14:56:21)

[release-14.0] Always add columns in the `Derived` operator
## Description

This is a backport of #12634


Patch:
diff --git a/go/vt/vtgate/planbuilder/physical/operator_funcs.go b/go/vt/vtgate/planbuilder/physical/operator_funcs.go
index bc1427e252..bfe594570b 100644
--- a/go/vt/vtgate/planbuilder/physical/operator_funcs.go
+++ b/go/vt/vtgate/planbuilder/physical/operator_funcs.go
@@ -228,11 +228,10 @@ func PushOutputColumns(ctx *plancontext.PlanningContext, op abstract.PhysicalOpe
 			var pos int
 			op.ColumnsOffset, pos = addToIntSlice(op.ColumnsOffset, i)
 			offsets = append(offsets, pos)
-			// skip adding to columns as it exists already.
+			op.Columns = append(op.Columns, col)
 			if i > -1 {
 				continue
 			}
-			op.Columns = append(op.Columns, col)
 			noQualifierNames = append(noQualifierNames, sqlparser.NewColName(col.Name.String()))
 		}
 		if len(noQualifierNames) > 0 {


Test patch:
diff --git a/go/vt/vtgate/planbuilder/testdata/select_cases.json b/go/vt/vtgate/planbuilder/testdata/select_cases.json
index 1c9c0ddfc0..d6b7a8c57b 100644
--- a/go/vt/vtgate/planbuilder/testdata/select_cases.json
+++ b/go/vt/vtgate/planbuilder/testdata/select_cases.json
@@ -5260,8 +5260,8 @@
               "Name": "user",
               "Sharded": true
             },
-            "FieldQuery": "select 1 from (select MAX(id) as maxt from music where 1 != 1) as other where 1 != 1",
-            "Query": "select 1 from (select MAX(id) as maxt from music where music.user_id = 5) as other",
+            "FieldQuery": "select other.maxt from (select MAX(id) as maxt from music where 1 != 1) as other where 1 != 1",
+            "Query": "select other.maxt from (select MAX(id) as maxt from music where music.user_id = 5) as other",
             "Table": "music",
             "Values": [
               "INT64(5)"
@@ -5563,8 +5563,8 @@
               "Name": "user",
               "Sharded": true
             },
-            "FieldQuery": "select 1 from (select MAX(id) as maxt from music where 1 != 1) as other where 1 != 1",
-            "Query": "select 1 from (select MAX(id) as maxt from music where music.user_id = 5) as other",
+            "FieldQuery": "select other.maxt from (select MAX(id) as maxt from music where 1 != 1) as other where 1 != 1",
+            "Query": "select other.maxt from (select MAX(id) as maxt from music where music.user_id = 5) as other",
             "Table": "music",
             "Values": [
               "INT64(5)"