You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "princejha95 (via GitHub)" <gi...@apache.org> on 2026/04/24 03:53:52 UTC
[PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
princejha95 opened a new pull request, #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114
<!-- Thanks for sending a pull request!
-->
<!-- Please make sure you have read and understood the contributing guidelines -->
- [x] I have registered the PR [changes](https://github.com/apache/incubator-seata-go/tree/master/changes).
**What this PR does**:
This PR make DayValue serialization timezone agnostic
**Which issue(s) this PR fixes**:
https://github.com/apache/incubator-seata-go/issues/887
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #
**Special notes for your reviewer**:
**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
Posted by "thunguo (via GitHub)" <gi...@apache.org>.
thunguo commented on PR #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114#issuecomment-4318426839
Consider whether any Copilot comments require action, and resolve the CI failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114#discussion_r3141628326
##########
pkg/util/flagext/day_test.go:
##########
@@ -63,6 +64,36 @@ func TestDayValueYAML(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, expected, actual)
+ var actualStruct TestStruct
+ err = yaml.Unmarshal(expected, &actualStruct)
+ require.NoError(t, err)
+ assert.Equal(t, testStruct, actualStruct)
+ }
+ // Test UTC-stable string and YAML serialization in western timezones.
+ {
+ loc, err := time.LoadLocation("America/Los_Angeles")
+ if err != nil {
+ loc = time.FixedZone("UTC-8", -8*60*60)
+ }
+
+ originalLocal := time.Local
+ time.Local = loc
+ defer func() {
+ time.Local = originalLocal
+ }()
+ type TestStruct struct {
+ Day *DayValue `yaml:"day"`
+ }
+ var testStruct TestStruct
+ testStruct.Day = &DayValue{}
+ require.NoError(t, testStruct.Day.Set("1985-06-02"))
+ expected := []byte(`day: "1985-06-02"
+`)
+
+ actual, err := yaml.Marshal(testStruct)
+ require.NoError(t, err)
+ assert.Equal(t, expected, actual)
Review Comment:
This new timezone-specific YAML test duplicates the prior "pointers of DayValue" block almost line-for-line. Consider making the pointer test table-driven (e.g., parameterize the location) or extracting a small helper to reduce duplication and make future additions (more timezones) easier.
##########
pkg/util/flagext/day_test.go:
##########
@@ -63,6 +64,36 @@ func TestDayValueYAML(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, expected, actual)
+ var actualStruct TestStruct
+ err = yaml.Unmarshal(expected, &actualStruct)
+ require.NoError(t, err)
+ assert.Equal(t, testStruct, actualStruct)
+ }
+ // Test UTC-stable string and YAML serialization in western timezones.
+ {
+ loc, err := time.LoadLocation("America/Los_Angeles")
+ if err != nil {
Review Comment:
The comment says this block tests "UTC-stable string and YAML serialization", but the test only asserts YAML marshal/unmarshal output and never checks DayValue.String(). Either add an assertion for the String() output under the modified time.Local, or adjust the comment to only mention YAML serialization to keep the test intent accurate.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
Posted by "thunguo (via GitHub)" <gi...@apache.org>.
thunguo merged PR #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
Posted by "thunguo (via GitHub)" <gi...@apache.org>.
thunguo commented on PR #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114#issuecomment-4524957867
Plz resolve the CI problem.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org
Re: [PR] fix: make DayValue serialization timezone stable [incubator-seata-go]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #1114:
URL: https://github.com/apache/incubator-seata-go/pull/1114#issuecomment-4318422819
## [Codecov](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1114?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `75.00000%` with `1 line` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 57.67%. Comparing base ([`55e99b4`](https://app.codecov.io/gh/apache/incubator-seata-go/commit/55e99b41024d9b907a3105fcef6f1d03b5ab4aa4?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`8fd7d66`](https://app.codecov.io/gh/apache/incubator-seata-go/commit/8fd7d66b219246ef760ec9f113ec44b90d5a0962?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1114?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [pkg/util/flagext/day.go](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1114?src=pr&el=tree&filepath=pkg%2Futil%2Fflagext%2Fday.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-cGtnL3V0aWwvZmxhZ2V4dC9kYXkuZ28=) | 75.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1114?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #1114 +/- ##
=======================================
Coverage 57.66% 57.67%
=======================================
Files 267 267
Lines 17665 17667 +2
=======================================
+ Hits 10187 10189 +2
Misses 6650 6650
Partials 828 828
```
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/incubator-seata-go/pull/1114?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org