PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: go-playground/validator (go)

Issue:
Required behaviour changed for time.Time
- [X] I have looked at the documentation [here](https://pkg.go.dev/github.com/go-playground/validator/v10#section-documentation) first?
- [X] I have looked at the examples provided that may showcase my question [here](/_examples)?

### Package version eg. v9, v10: 

v10.15.2

### Issue, Question or Enhancement:

A zero `time.Time` passes the `required` validation in v10.15.2 but not in v10.15.1. Adding in `WithRequiredStructEnabled` to the `New()` func does enable the test to pass but I'm not sure if I should make this code change in our codebase; should the default behaviour have changed between these minor releases?

I've provided a sample test that passes in v10.15.1 but fails in v10.15.2.

### Code sample, to showcase or reproduce:

```go
func TestTimeRequired(t *testing.T) {
	validate := New()
	validate.RegisterTagNameFunc(func(fld reflect.StructField) string {
		name := strings.SplitN(fld.Tag.Get("json"), ",", 2)[0]

		if name == "-" {
			return ""
		}

		return name
	})

	type TestTime struct {
		Time time.Time `validate:"required"`
	}

	var testTime TestTime

	err := validate.Struct(&testTime)
	NotEqual(t, err, nil)
	AssertError(t, err.(ValidationErrors), "TestTime.Time", "TestTime.Time", "Time", "Time", "required")
}
```


Pull request:
fix edge case
## Fixes Or Enhances

Fixes #1162 by not skipping the `required` for non nested structs accidentally introduced in last release.

Patch:
diff --git a/validator.go b/validator.go
index 2cae8f7..342c4ec 100644
--- a/validator.go
+++ b/validator.go
@@ -173,7 +173,7 @@ func (v *validate) traverseField(ctx context.Context, parent reflect.Value, curr
 		// structs. Since it's basically nonsensical to use `required` with a non-pointer struct
 		// are explicitly skipping the required validation for it. This WILL be removed in the
 		// next major version.
-		if !v.v.requiredStructEnabled && ct != nil && ct.tag == requiredTag {
+		if isNestedStruct && !v.v.requiredStructEnabled && ct != nil && ct.tag == requiredTag {
 			ct = ct.next
 		}
 	}


Test patch:
diff --git a/validator_test.go b/validator_test.go
index 1dfa85c..09ff1df 100644
--- a/validator_test.go
+++ b/validator_test.go
@@ -13534,3 +13534,26 @@ func TestNestedStructValidation(t *testing.T) {
 		})
 	}
 }
+
+func TestTimeRequired(t *testing.T) {
+	validate := New()
+	validate.RegisterTagNameFunc(func(fld reflect.StructField) string {
+		name := strings.SplitN(fld.Tag.Get("json"), ",", 2)[0]
+
+		if name == "-" {
+			return ""
+		}
+
+		return name
+	})
+
+	type TestTime struct {
+		Time time.Time `validate:"required"`
+	}
+
+	var testTime TestTime
+
+	err := validate.Struct(&testTime)
+	NotEqual(t, err, nil)
+	AssertError(t, err.(ValidationErrors), "TestTime.Time", "TestTime.Time", "Time", "Time", "required")
+}
Repository: HyperBrain/serverless-aws-alias (js)

Issue:
Warmup
Hi,
Thanks for this very useful project.
I've add the warmup plugin with the prewarm option.
I've seen the integration in the warmup plugin of the alias var.

I was wondering if it's possible to warmup the new version of the lambda deployed before the alias is changed to point on it.
The aim is to avoid lambda timeout after the alias is changed because of the long coldstart period.

Any ideas ?
Thanks,

Fred.



Pull request:
Set SERVERLESS_ALIAS during build
Fixes #72 

The warmup plugin (and maybe others as well) uses the SERVERLESS_ALIAS environment variable to determine if the functions are deployed to a specific alias.

Until now the variable was only available at runtime, so the evaluation failed.

It is now set in the validate() function, so that the plugins can easily grab it.

Patch:
diff --git a/lib/validate.js b/lib/validate.js
index de29d14..2f446bb 100644
--- a/lib/validate.js
+++ b/lib/validate.js
@@ -23,6 +23,9 @@ module.exports = {
 		// Make alias available as ${self:provider.alias}
 		this._serverless.service.provider.alias = this._alias;
 
+		// Set SERVERLESS_ALIAS environment variable to let other plugins access it during the build
+		process.env.SERVERLESS_ALIAS = this._alias;
+
 		// Parse and check plugin options
 		if (this._options['alias-resources']) {
 			this._aliasResources = true;


Test patch:
diff --git a/test/validate.test.js b/test/validate.test.js
index 71379d0..6db5359 100644
--- a/test/validate.test.js
+++ b/test/validate.test.js
@@ -56,6 +56,11 @@ describe('#validate()', () => {
 		]));
 	});
 
+	it('should set SERVERLESS_ALIAS', () => {
+		return expect(awsAlias.validate()).to.eventually.be.fulfilled
+		.then(() => expect(process.env.SERVERLESS_ALIAS).to.equal('myStage'));
+	});
+
 	it('should succeed', () => {
 		return expect(awsAlias.validate()).to.eventually.be.fulfilled;
 	});