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

Added examples on how to use schedules #272

Merged
merged 2 commits into from
May 15, 2024
Merged

Added examples on how to use schedules #272

merged 2 commits into from
May 15, 2024

Conversation

IaroslavTitov
Copy link
Contributor

@IaroslavTitov IaroslavTitov commented May 10, 2024

Summary

  • Added C# example on creating schedules
  • Added Typescript example on creating schedules
  • Added Yaml example on creating schedules
  • Added them to list of tests
  • Fixes 274

Testing

  • Tested all in local projects

@IaroslavTitov IaroslavTitov added the impact/no-changelog-required This issue doesn't require a CHANGELOG update label May 10, 2024
@IaroslavTitov IaroslavTitov force-pushed the iaro/example branch 10 times, most recently from d3e6c84 to ea2b9ac Compare May 13, 2024 20:20
@IaroslavTitov IaroslavTitov requested a review from komalali May 13, 2024 20:27
@IaroslavTitov IaroslavTitov marked this pull request as ready for review May 13, 2024 20:27
@komalali
Copy link
Member

@IaroslavTitov I just made a change to the service that now validates if the stack has deployment settings and returns an error if it doesn't. So you may need to update these tests to also include deployment setting resources.

@IaroslavTitov IaroslavTitov force-pushed the iaro/example branch 4 times, most recently from fec0ddb to f532a26 Compare May 15, 2024 20:31
Comment on lines +32 to +34
Organization = "service-provider-test-org",
Project = "cs-schedules",
Stack = "test-stack",
Copy link
Member

@komalali komalali May 15, 2024

Choose a reason for hiding this comment

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

You can use the output from deployment settings as an input here to create the dependency chain to ensure that the schedules are always created after the settings.

Suggested change
Organization = "service-provider-test-org",
Project = "cs-schedules",
Stack = "test-stack",
Organization = settings.Organization,
Project = settings.Project,
Stack = settings.Stack,

The alternative is to add a dependsOn, but IMO this is cleaner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I used dependsOn below to make dependency explicit, and mentioned it above in comment to explain to the reader.

I can do the settings properties too, agree that it's cleaner. However, in this case, since it's an example I think explicitly showing dependency is better, but can change, don't mind either way

Copy link
Member

Choose a reason for hiding this comment

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

Ah whoops I see it now. Fine to leave as-is.

Comment on lines +48 to +50
Organization = "service-provider-test-org",
Project = "cs-schedules",
Stack = "test-stack",
Copy link
Member

Choose a reason for hiding this comment

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

Same idea everywhere below

Suggested change
Organization = "service-provider-test-org",
Project = "cs-schedules",
Stack = "test-stack",
Organization = settings.Organization,
Project = settings.Project,
Stack = settings.Stack,

@IaroslavTitov IaroslavTitov enabled auto-merge (squash) May 15, 2024 20:54
@IaroslavTitov IaroslavTitov merged commit 20e1f53 into main May 15, 2024
13 checks passed
@IaroslavTitov IaroslavTitov deleted the iaro/example branch May 15, 2024 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/no-changelog-required This issue doesn't require a CHANGELOG update
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add examples on how to use Schedule resources (TTL, Drift, DeploymentSchedule)
2 participants