Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[incubator-kie-issues#69] Time with a timezone is parsed into type Parsed #5996

Merged
merged 5 commits into from
Jun 21, 2024

Conversation

gitgabrio
Copy link
Contributor

Fixes apache/incubator-kie-issues#69

This PR:

  1. creates ZonedOffsetTime decorator to provide both offset and zone information over a time with timezone
  2. adapt TimeFunction to return the above, when needed, implementing the missing use-cas (when parsed object contains a zone)
  3. add minor required fixes for the new class usage
  4. add relevant tests
How to replicate CI configuration locally?

Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.

How to retest this PR or trigger a specific build:
  • for pull request and downstream checks

    • Push a new commit to the PR. An empty commit would be enough.
  • for a full downstream build

    • for github actions job: add the label run_fdb
  • for Jenkins PR check only

@yesamer yesamer added the DMN label Jun 18, 2024
Copy link
Contributor

@yesamer yesamer left a comment

Choose a reason for hiding this comment

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

Approved, just a few minor questions

* It is used to provide both offset and zoneid information, replacing the <code>Parsed</code> instance that would be returned otherwise by
* {@link org.kie.dmn.feel.runtime.functions.TimeFunction#invoke(String)}
*/
public final class ZonedOffsetTime
Copy link
Contributor

Choose a reason for hiding this comment

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

@gitgabrio Could make sense to unit test this new class?

{ "@\"P1D\" + @\"10:15:00@Australia/Melbourne\"", getCorrectOffsetTime( "10:15", "Australia/Melbourne"), null},
{ "@\"-P1D\" + @\"10:15:00@Australia/Melbourne\"", getCorrectOffsetTime( "10:15", "Australia/Melbourne"), null},
{ "@\"PT1H\" + @\"10:15:00@Australia/Melbourne\"", getCorrectOffsetTime( "11:15", "Australia/Melbourne"), null},
{ "@\"-PT1H\" + @\"10:15:00@Australia/Melbourne\"", getCorrectOffsetTime( "09:15", "Australia/Melbourne"), null},
Copy link
Contributor

Choose a reason for hiding this comment

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

@gitgabrio Can you please add some test cases with Substract?

@gitgabrio gitgabrio marked this pull request as draft June 19, 2024 15:07
@gitgabrio gitgabrio marked this pull request as ready for review June 21, 2024 07:20
@gitgabrio gitgabrio merged commit af0f91a into apache:main Jun 21, 2024
19 checks passed
@gitgabrio gitgabrio deleted the incubator-kie-issues#69 branch June 21, 2024 08:39
rgdoliveira pushed a commit to rgdoliveira/drools that referenced this pull request Jul 8, 2024
…rsed (apache#5996)

* [incubator-kie-issues#69] Creating ZonedOffsetTime decorator and related tests

* [incubator-kie-issues#69] Fixing test to consider different offsets based on current date

* [incubator-kie-issues#69] Fix as per pr suggestion

* [incubator-kie-issues#69] Fix as per pr suggestion

* [incubator-kie-issues#69] Fixing formatting on ZoneTime

---------

Co-authored-by: Gabriele-Cardosi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Time with a timezone is parsed into type Parsed
3 participants