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

Add madeRequired decorator and tests #3292

Merged
merged 4 commits into from
May 9, 2024

Conversation

borrrden
Copy link
Contributor

@borrrden borrrden commented May 7, 2024

Hopefully I got all the places I needed to get and added enough tests. My methodology was pretty much "Look at what madeOptional does, and do the opposite"

Closes #2731

@borrrden
Copy link
Contributor Author

borrrden commented May 7, 2024

@microsoft-github-policy-service agree

@borrrden borrrden force-pushed the add_madeRequired branch from 26f3a87 to bfb6149 Compare May 7, 2024 02:30
@azure-sdk
Copy link
Collaborator

azure-sdk commented May 7, 2024

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @typespec/versioning
Show changes

Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the contribution, from the pure decorator point of view this looks good.
However this current implementation will mot allow a property go go optional -> required -> optional multiple times(or the other way around).

This is something we can do today with @added and @removed.

What we basically need is to create the same availability timeline but for the requireness of a property and have a isOptionalAtVersion helper.

@azure-sdk
Copy link
Collaborator

You can try these changes at https://cadlplayground.z22.web.core.windows.net/prs/3292/

Check the website changes at https://tspwebsitepr.z22.web.core.windows.net/prs/3292/

@borrrden
Copy link
Contributor Author

borrrden commented May 7, 2024

Not sure I can work out all of that from an outside view. I understand the problem but not enough of the semantics of how this all works just yet. I'll have a look and see what I can reason about given what the added and removed decorators do.

@borrrden
Copy link
Contributor Author

borrrden commented May 7, 2024

Also what's with the "undocumented changes"? It doesn't seem to show me any changes to document....

@timotheeguerin
Copy link
Member

Yeah not worries, it was scheduled to be worked on this coming month so I can add that to your pr.

For the doc change it's asking for change log tracking. Just click on the link in the comment to add a change entry. Or use Pnpm change add locally

@borrrden borrrden force-pushed the add_madeRequired branch from 994883e to c9f9d70 Compare May 9, 2024 02:06
@timotheeguerin
Copy link
Member

/azp run typespec - pr tools

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@microsoft microsoft deleted a comment from azure-pipelines bot May 9, 2024
@borrrden
Copy link
Contributor Author

borrrden commented May 9, 2024

I thought I had this down but the PR checks apparently have ME down instead :p

Copy link
Member

@timotheeguerin timotheeguerin left a comment

Choose a reason for hiding this comment

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

@borrrden talked with the team and we'll file a follow up issue to add the scenarios I was talking about above as you already cover the 99% use case.

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.

Missing @madeRequired decorator for versioning
3 participants