Skip to content

Conversation

@mik-laj
Copy link
Member

@mik-laj mik-laj commented May 5, 2020

Hello,

This is my second proposal for the API specification (first: #7549). The previous one was merged without acceptance. I am very sorry for this very not cool behaviour. Now based on this change proposes specifications again. I will now try to introduce changes more transparently. I have created a lot of changes that are responses to comments on the previous version. I will now try to add reference to commit for each comment.

Preview:
Swaagger UI:
https://editor.swagger.io/?url=https://raw.githubusercontent.com/PolideaInternal/airflow/openapi-spec/openapi.yaml
Redoc:
https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/PolideaInternal/airflow/openapi-spec/openapi.yaml#operation/getConfig

Best regards,
Kamil


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • [xI will engage committers as explained in Contribution Workflow Example.

In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.

@mik-laj mik-laj added the area:API Airflow's REST/HTTP API label May 5, 2020
@mik-laj mik-laj force-pushed the openapi-spec branch 2 times, most recently from 9b6a87c to f0d53f4 Compare May 5, 2020 19:11
@mik-laj mik-laj mentioned this pull request May 5, 2020
6 tasks
@mik-laj
Copy link
Member Author

mik-laj commented May 28, 2020

Errors

Semantic error at paths./dags/{dag_id}.get.requestBody
GET operations cannot have a requestBody.
Jump to line 181

I am fixing it. I also checked if the problem occurs elsewhere.

yq r openapi.yaml  --tojson | jq '.paths |to_entries|map(select(.value.get.requestBody))'
[]

@mik-laj mik-laj requested a review from ashb May 28, 2020 15:29
@mik-laj
Copy link
Member Author

mik-laj commented May 28, 2020

@ashb I answered all comments. Would you like to add something else? 😸

@ashb
Copy link
Member

ashb commented May 28, 2020

Only outstanding point is about #8721 (comment) (conf param to trigger as string vs object) -- I'll take it to the mailing list.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

Need to change key to xcom_key - it's too generic and causes Java automatically generated client to fail

openapi.yaml Outdated

XComKey:
in: path
name: key
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
name: key
name: key
Suggested change
name: key
name: xcom_key

Copy link
Member

Choose a reason for hiding this comment

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

I'm not a fan of this really -- what specifically is the problem this causes for Java?

Copy link
Member Author

Choose a reason for hiding this comment

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

Here are a related change. (I did it before I read your message.) We can revert it if we make a different decision.
5993aef

Copy link
Member

Choose a reason for hiding this comment

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

Generated code of the method uses internally "key" variable to loop through the parameters. In Java you cannot have same variable and parameter name.

I will be happy if you find any other solution for that.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

And BTW. this is the main reason why I created #9080 and I am super keen on automating the checks if the main language open-api clients can be automatically generated and compiled. Sometimes thing like choosing a name might matter (of course it should not matter in theory but we are leaving in an imperfect world). Making the clients generated and being usable is a priority for me in this case,

Copy link
Member

Choose a reason for hiding this comment

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

Code here: https://github.com/mik-laj/airflow-api-clients/blob/master/out/object/java-google-api-client/src/main/java/org/openapitools/client/api/XComApi.java#L108 (now the parameter is named xcomkey - it used to be named key)

It didn't cause any problems in my compile tests...

Ah. I tested with the java-okhttp-gson, and it doesn't have that problem.

So next question: do we want to/need support every possible API generator? that's a lot of combinations to build+test+support?

Have we reported this bug upstream too?

openapi.yaml Outdated
default: true
readOnly: True
conf:
type: string
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
type: string
type: object

Copy link
Member Author

Choose a reason for hiding this comment

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

@mik-laj
Copy link
Member Author

mik-laj commented Jun 1, 2020

Can I still help in finishing this change? I think that the discussion between xcom_key and key is not a big issues, and even goes beyond the scope of this change. We have learned that in addition to the OpenAPi 3.0 specification it is worth considering other requirements and they will definitely affect the final specifications during the following months.

@potiuk
Copy link
Member

potiuk commented Jun 1, 2020

I think we should submit with xcom_key as we know that it at least compile in open-api generator. So I suggest we merge it as is. @ashb -> I think the two interns are pretty much blocked by this change and they could start working on it. we can always make a follow-up change later on if we find a better solution. I want to make the follow-up CI change soon as well so that any future change/proposal will get automatically tested.

Copy link
Member

@potiuk potiuk left a comment

Choose a reason for hiding this comment

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

LGTM

@ashb
Copy link
Member

ashb commented Jun 1, 2020

Yeah not a fan of xcomKey vs key but not a blocker from me.

openapi.yaml Outdated

# Common data type
ScheduleInterval:
allOf:
Copy link
Member

Choose a reason for hiding this comment

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

This one should be oneOf

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks. I updated the spec.
6153d5b

@ashb
Copy link
Member

ashb commented Jun 1, 2020

Curious, wonder why Mergeable is failing here...

@kaxil
Copy link
Member

kaxil commented Jun 1, 2020

Curious, wonder why Mergeable is failing here...

Because of "dont-merge" label

@kaxil kaxil removed the dont-merge label Jun 1, 2020
@ashb
Copy link
Member

ashb commented Jun 1, 2020

🎉

@mik-laj
Copy link
Member Author

mik-laj commented Jun 1, 2020

Screenshot 2020-06-01 at 21 30 18

Screenshot 2020-06-01 at 21 30 49

The longest discussion 🐈

Thank you all for a great job. This is just one file and the beginning of implementation.

@mik-laj mik-laj merged commit 20f8982 into apache:master Jun 1, 2020
@mik-laj mik-laj deleted the openapi-spec branch June 1, 2020 19:46
@houqp
Copy link
Member

houqp commented Jun 2, 2020

thanks @mik-laj for driving this and congrats everyone for a big milestone :)

@turbaszek
Copy link
Member

Thanks @mik-laj ! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:dev-tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants