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

Parse Java docs to pull useful information from mission model #1055

Closed
wants to merge 25 commits into from

Conversation

cohansen
Copy link
Contributor

@cohansen cohansen commented Aug 2, 2023

Description

This PR works off @mattdailis's prototype javadoc parsing code. I added a JavadocParser class that handles specific parsing for @aerie.unit, @aerie.computedAttribute, and @aerie.resourceName.

  1. For general parameter parsing we look in 2 different spots:
    • They can be annotated at the record level, this requires a @param tag followed by a @aerie.unit tag on a new line. Example
    • Or they can be annotated as a class property, this doesn't require an explicit @param tag. Example
  2. Resource types are annotated in the @MissionModel in 2 different spots as well, they are annotated with a @aerie.resourceName followed by a @aerie.unit tag on a new line:
    • They can exist as a block comment on the MissionModel class itself. Example
    • Or they can be on a property of the MissionModel. Example
  3. The last new tag is @aerie.computedAttribute, which must be annotated on a Record type returned from the @EffectModel. Example

One thing to discuss as part of this PR is if we should prefix all of our custom tags with @Aerie or something similar. This would be more verbose but would avoid any conflicts if we pull in a library that uses the same tags as we do or they become official tags as part of the Javadoc spec.

This PR introduces breaking changes for the UI because we have renamed the following fields:

  • activity_type.parameters -> activity_type.parameter_definitions
  • activity_type.computed_attributes_value_schema -> activity_type.computed_attribute_definitions
  • mission_model_parameters.parameters -> mission_model_parameters.parameter_definitions
  • resource_type.schema -> resource_type.definition

Verification

Tests were added for some of the parsing, these could be improved as right now we don't have coverage for resource types and computed attributes. If the best place to add this is inside of FooMissionModel, I can do that as part of this PR.

Documentation

NASA-AMMOS/aerie-docs#71

Future work

More javadoc tag parsing, up next is @subsystem and @color (#934) which will change some of this code.

@cohansen cohansen requested a review from a team as a code owner August 2, 2023 17:19
@cohansen cohansen requested review from jmdelfa and skovati August 2, 2023 17:19
@cohansen cohansen self-assigned this Aug 2, 2023
@cohansen cohansen temporarily deployed to e2e-test August 2, 2023 17:19 — with GitHub Actions Inactive
@cohansen cohansen force-pushed the prototype/parse-javadoc branch from 1018777 to 1182346 Compare August 2, 2023 17:24
@cohansen cohansen temporarily deployed to e2e-test August 2, 2023 17:24 — with GitHub Actions Inactive
@cohansen cohansen temporarily deployed to e2e-test August 2, 2023 17:30 — with GitHub Actions Inactive
@cohansen cohansen temporarily deployed to e2e-test August 2, 2023 17:49 — with GitHub Actions Inactive
@cohansen cohansen force-pushed the prototype/parse-javadoc branch from 2a519c6 to 40326d5 Compare August 2, 2023 18:05
@cohansen cohansen temporarily deployed to e2e-test August 2, 2023 18:06 — with GitHub Actions Inactive
@camargo camargo added the feature A new feature or feature request label Aug 2, 2023
@camargo camargo changed the title Prototype/parse javadoc Parse Java docs to pull useful information from mission model Aug 2, 2023
@cohansen cohansen force-pushed the prototype/parse-javadoc branch from 40326d5 to 05d8ad5 Compare August 3, 2023 15:20
@cohansen cohansen temporarily deployed to e2e-test August 3, 2023 15:20 — with GitHub Actions Inactive
@cohansen cohansen temporarily deployed to e2e-test August 3, 2023 15:20 — with GitHub Actions Inactive
@cohansen cohansen force-pushed the prototype/parse-javadoc branch from 05d8ad5 to 03cf6eb Compare August 4, 2023 17:04
@cohansen cohansen temporarily deployed to e2e-test August 4, 2023 17:04 — with GitHub Actions Inactive
Comment on lines +202 to +203
console.log(activitySchema);

Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: console.log needs to be removed

Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this file need to be modifying the entries in these columns, as the entries have additional keys?

@cohansen cohansen closed this Sep 28, 2023
@cohansen cohansen deleted the prototype/parse-javadoc branch September 28, 2023 15:25
@mattdailis mattdailis mentioned this pull request Oct 5, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or feature request merlin framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pull Units from mission model annotations and store them in DB
4 participants