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

[FEATURE] custom validation rules for buildDefinition & deploy & retrieve #1645

Closed
JoernBerkefeld opened this issue Sep 2, 2024 · 1 comment · Fixed by #1649 or #1642
Closed

[FEATURE] custom validation rules for buildDefinition & deploy & retrieve #1645

JoernBerkefeld opened this issue Sep 2, 2024 · 1 comment · Fixed by #1649 or #1642
Assignees
Labels
enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" NEW not yet analyzed new issues get this label validationRule
Milestone

Comments

@JoernBerkefeld
Copy link
Contributor

based on

idea is that we offer an option to run a callback function (needs to be nicely encapsulated to not break mcdev) to offer full flexibility.

the hook should run

  • at the end of the preDeployTasks to basically allow adding your own preDeployTasks. If the custom script fails, it should block deployment.
  • in buildDefinition after all templating variables were applied. This way we can show warnings

the method parameters:

  • metadata (or the code-json split version of it)
  • target BU (cred/bu)

the method may be async - we shall put an await in front of it for good measure and a try catch around it to format the error message.

it shall either return the (potentially adapted) object it received as parameter OR throw a descriptive error.

in preDeployTasks, that error will NOT be caught, preventing deployment
in buildTemplate it will be caught and displayed as a warning, allowing the file to be saved in the deploy folder

the callback-javascript file path can be set via a new option in .mcdevrc, relative to the project root

@JoernBerkefeld JoernBerkefeld added enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" NEW not yet analyzed new issues get this label labels Sep 2, 2024
@JoernBerkefeld JoernBerkefeld added this to the 7.4.0 milestone Sep 2, 2024
@JoernBerkefeld JoernBerkefeld self-assigned this Sep 2, 2024
@JoernBerkefeld JoernBerkefeld modified the milestones: 7.4.0, 7.3.2 Sep 2, 2024
@github-actions github-actions bot closed this as completed Sep 2, 2024
Copy link

github-actions bot commented Sep 2, 2024

Closed by #1649.

@JoernBerkefeld JoernBerkefeld mentioned this issue Sep 2, 2024
11 tasks
@JoernBerkefeld JoernBerkefeld changed the title [FEATURE] custom validation rules for buildDefinition & deploy [FEATURE] custom validation rules for buildDefinition & deploy & retrieve Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request; requires increasing the minor version of mcdev. Jira issue-type "Story" NEW not yet analyzed new issues get this label validationRule
Projects
None yet
1 participant