Skip to content

chip-ingress: newevent - refactor timestamp to millisecond and add 0 check#1576

Merged
patrickhuie19 merged 3 commits intomainfrom
chore/chip-ingress-ce-attributes
Oct 1, 2025
Merged

chip-ingress: newevent - refactor timestamp to millisecond and add 0 check#1576
patrickhuie19 merged 3 commits intomainfrom
chore/chip-ingress-ce-attributes

Conversation

@engnke
Copy link
Copy Markdown
Contributor

@engnke engnke commented Oct 1, 2025

chip-ingress cloudevent
part of: https://smartcontract-it.atlassian.net/browse/INFOPLAT-3003?focusedCommentId=465270
ask to have timestamp in milliseconds and add nil check for 0 time values showing up

@engnke engnke requested a review from a team as a code owner October 1, 2025 16:28
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

👋 engnke, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 1, 2025

apidiff results - no incompatible changes detected ✅

(Full summary: https://github.com/smartcontractkit/chainlink-common/actions/runs/18168857811/#summary-51718230423)

@engnke engnke requested a review from a team October 1, 2025 17:33
"dataschema": "https://example.com/schema",
"subject": "example-subject",
"time": time.Now(),
"time": time.Now().Add(-5 * time.Second),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does adding -5 seconds do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its setting the time attribute to 5 seconds ago.
recordedtime is set by default to time.now and it should always occur after time

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with the change to milliseconds the difference has to be greater for the testcase to pass (line 90)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, so truncating to millisecond causes the test to fail b/c in the older version the nano second difference in time.Now() took care of recordedtime occuring after time?

@patrickhuie19 patrickhuie19 merged commit efac15b into main Oct 1, 2025
20 of 22 checks passed
@patrickhuie19 patrickhuie19 deleted the chore/chip-ingress-ce-attributes branch October 1, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants