-
Notifications
You must be signed in to change notification settings - Fork 22
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
[AERIE-1935] Expose plan start time to mission model #278
[AERIE-1935] Expose plan start time to mission model #278
Conversation
f1078c6
to
2976b19
Compare
2976b19
to
8b36139
Compare
3c414b4
to
d2d2979
Compare
d2d2979
to
8bcd5a3
Compare
8bcd5a3
to
5d210cb
Compare
cf28708
to
1f182f0
Compare
From reading the PR description, it sounds like the annotation approach would be preferable, but we're concerned that having different annotations for records vs regular classes would cause confusion. Am I reading that correctly? Would it help to have two similarly named annotations in different names paces, or would that make it even more confusing? |
I'd expect this to be possible. Annotations don't do anything on their own -- it's up to our processor how to interpret them. If you're concerned about how to set @Target({ElementType.RECORD_COMPONENT, ElementType.FIELD})
@interface SimulationStart {
} (Also, can you remind me what the difference is between the simulation start time and the plan start time?) |
That question is asking about propagating annotations on |
Sim. start time is passed through from a "create sim. message". Currently I believe they should always be the same but we're carefully making sure to use sim. start time here since I believe in the future we may have sim. and plan start time differ (for example when re-running part of a sim. I believe). |
Thanks for the help! I'll rework this PR to use a single annotation with multiple targets. Having this annotation apply to only config. types will complicate our mapper code-gen. but an annotation does seem like the correct approach. :) |
916ed77
to
b535e66
Compare
b535e66
to
7e89761
Compare
7e89761
to
5e38754
Compare
5e38754
to
2ac4e84
Compare
2ac4e84
to
a10a0c5
Compare
a10a0c5
to
e09f61d
Compare
29c7e1d
to
ec642fe
Compare
Everything is now stable. Done making changes :) |
ec642fe
to
6c98d18
Compare
Just to understand it better the mission model will use the |
When running a simulation the actual plan start time will be used :) |
Thanks for the info!! I also just read through the slack thread I missed between you, Matt, and Jonathan, which gave me more context. |
Thanks Ryan, appreciate you spending time on this w/ us! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not much I would improve upon. Just make sure you create another ticket for the mission model redesign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. If you haven't already, let's make a ticket to come up with the longer term solution.
EDIT: Whoops, just saw that Ryan said the same thing
Description
Mission modelers currently don't have access to a plan's start time.
With this PR a plan start time
Instant
parameter can optionally be declared in the top-level mission model ("Mission.java
") constructor.If a top-level mission model defines a constructor with
Instant
as the 2nd argument then the sim. start time will be passed to the mission model upon instantiation. If theInstant
parameter (orRegistrar
parameter and optionally a "Configuration
" parameter) is declared out-of-order then an actionable error message is now presented at compile-time. See the section below for examples.More concretely, the following top-level mission model constructor parameters are allowed (lifted from
MissionModelParser.java
):As seen above, both sim. start time and mission model configuration parameters are optional. However, if both are defined "
Configuration
" must be declared last. This ensures backwards compatibility with existing mission models while allowing future mission models to make use of thisInstant
.See the future work section for a discussion on alternative approaches for this PR.
Verification
See
foo-missionmodel
'sMissionConfigurationTest
.Error Handling
When the following
Mission
constructor parameters are declared in an allowable order no compile-time error is thrown:However, when
Instant
(or any of the above parameters) are declared out of expected order a custom error message will appear:In this example,
Mission
's constructor was declared with a plan startInstant
in the wrong expected order:Documentation
deployment/Environment.md
anddeployment/README.md
for information onUNTRUE_PLAN_START
.Future work
Initially a
@PlanStart
annotation was considered but in prototyping this implementation it was found that this change would require plan information to be passed in at our GQL layer (to allow any configured context to have plan information).This would break existing GQL queries and more tightly couple our plan and model "domains".
See Slack thread for more context and discussion on this.