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

feat: return deprecation warnings to users in yellow in colour. #586

Merged
merged 6 commits into from
May 3, 2023

Conversation

Peeeekay
Copy link
Contributor

@Peeeekay Peeeekay commented Apr 28, 2023

Description:

After this change - users can be notified about potential deprecated instructions/types/fields. It is abstracted away so that engineers can easily add relevant information for users to see. They also have ability to share other warning with users if need be.

Is this change user facing?

YES

References (if applicable):

Base automatically changed from pk/print_warning_only_once to main April 28, 2023 20:06
feat: added abstractions for deprecation warning
@Peeeekay Peeeekay changed the title Pk/add abstraction for warning feat: return deprecation warnings to users in yellow in colour. Apr 28, 2023
@Peeeekay Peeeekay changed the base branch from main to 2023-03-22-breaking-release April 28, 2023 20:16
@Peeeekay Peeeekay changed the base branch from 2023-03-22-breaking-release to main April 28, 2023 20:16
@Peeeekay Peeeekay force-pushed the pk/add_abstraction_for_warning branch from 92348f5 to 2e2e8b2 Compare April 28, 2023 20:17
@Peeeekay
Copy link
Contributor Author

Peeeekay commented Apr 28, 2023

To add deprecation warning we can just do the following:

Deprecating an argument/field for instruction or type:-

KurtosisBaseBuiltin: &kurtosis_starlark_framework.KurtosisBaseBuiltin{
			Name: AddServiceBuiltinName,

			Arguments: []*builtin_argument.BuiltinArgument{
				{
					Name:              ServiceNameArgName,
					IsOptional:        false,
					ZeroValueProvider: builtin_argument.ZeroValueProvider[starlark.String],
				        Deprecation: starlark_warning.Deprecation(
			                          starlark_warning.DeprecationDate{Day: 20, Month: 11, Year: 2023},
			                         "Please use `xyx` field instead - for more info ...",
		                         ),

					Validator: func(value starlark.Value) *startosis_errors.InterpretationError {
						return builtin_argument.NonEmptyString(value, ServiceNameArgName)
					},
				},
			},
		},

The warning message will be: WARN: "service_config" field for "add_service" will be deprecated by 20/11/2023. mitigation reason

Deprecating an instruction or type:-

KurtosisBaseBuiltin: &kurtosis_starlark_framework.KurtosisBaseBuiltin{
			Name: AddServiceBuiltinName,
                         Deprecation: starlark_warning.Deprecation(
			          starlark_warning.DeprecationDate{Day: 20, Month: 11, Year: 2023},
			          "Please use `xyx` instruction instead - for more info ...",
		         ),
			Arguments: []*builtin_argument.BuiltinArgument{
				....
			},
		},

The warning message will be: WARN: "add_service" instruction will be deprecated by 20/11/2023. mitigation reason

@Peeeekay Peeeekay marked this pull request as ready for review April 28, 2023 21:22
Copy link
Contributor

@adschwartz adschwartz left a comment

Choose a reason for hiding this comment

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

@Peeeekay This looks good to me. My understanding is that this is the first PR. I see you have some todo's, are those meant for future work, or are those coming up in the next PR?

Either way this looks like a good first prototype.

@Peeeekay
Copy link
Contributor Author

Peeeekay commented May 1, 2023

@adschwartz - those are future work which can be tackled as FLUPs - which I will create. They are not urgent but good to have.

@Peeeekay Peeeekay merged commit 7609fd8 into main May 3, 2023
@Peeeekay Peeeekay deleted the pk/add_abstraction_for_warning branch May 3, 2023 01:56
victorcolombo pushed a commit that referenced this pull request May 11, 2023
🤖 I have created a release *beep* *boop*
---


##
[0.76.4](0.76.3...0.76.4)
(2023-05-11)


### Features

* Add Windows support for CLI
([#608](#608))
([4cc1c56](4cc1c56))
* added sign-up for kcloud
([#591](#591))
([16641e9](16641e9))
* Help developers to work across the project modules
([#596](#596))
([e7f845e](e7f845e))
* return deprecation warnings to users in yellow in colour.
([#586](#586))
([7609fd8](7609fd8))


### Bug Fixes

* Enable autocomplete for the `files upload` path argument
([#598](#598))
([be52f9e](be52f9e))
* kurtosis --> kurtosistech in readme
([#604](#604))
([d6c2ea2](d6c2ea2))
* Pipe metric reporting logs to logger instead of stderr
([#576](#576))
([7060473](7060473))
* Refresh the README dev instructions
([#595](#595))
([0c71fac](0c71fac))
* rename cloud-->kloud in readme
([#602](#602))
([a998d39](a998d39))
* Support redirects with cookies in the user support URLs validation
test ([#600](#600))
([ce9718e](ce9718e)),
closes [#599](#599)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: kurtosisbot <kurtosisbot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants