-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Introduce type-safe and consistent pattern for handling build globals #48778
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
Introduce type-safe and consistent pattern for handling build globals #48778
Conversation
This commit introduces a consistent, and type-safe manner for handling global build parameters through out our build logic. Primarily this replaces the existing usages of extra properties with static accessors. It also introduces and explicit API for initialization and mutation of any such parameters, as well as better error handling for uninitialized or eager access of parameter values. Closes elastic#42042 Signed-off-by: Mark Vieira <[email protected]>
|
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
Signed-off-by: Mark Vieira <[email protected]>
…bals # Conflicts: # distribution/docker/build.gradle # plugins/repository-azure/qa/microsoft-azure-storage/build.gradle
Signed-off-by: Mark Vieira <[email protected]>
Signed-off-by: Mark Vieira <[email protected]>
|
If you want more background on the motivations here please take a look at the description of #42042. This refactoring primarily enables the IDE to provide considerably better insight into how these globals are used. I can now easily see all usages: And navigate quickly to where a parameter is initialized: And of course all the other nice refactoring abilities enabled by the IDE when things are static references vs dynamic properties. |
rjernst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clever. LGTM.
…elastic#48778) This commit introduces a consistent, and type-safe manner for handling global build parameters through out our build logic. Primarily this replaces the existing usages of extra properties with static accessors. It also introduces and explicit API for initialization and mutation of any such parameters, as well as better error handling for uninitialized or eager access of parameter values. Closes elastic#42042 (cherry picked from commit af6af34)


This commit introduces a consistent, and type-safe manner for handling
global build parameters through out our build logic. Primarily this
replaces the existing usages of extra properties with static accessors.
It also introduces and explicit API for initialization and mutation of
any such parameters, as well as better error handling for uninitialized
or eager access of parameter values.
Closes #42042