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] Add pre_validate post_validate hooks in reference #4013

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

uilianries
Copy link
Member

Signed-off-by: Uilian Ries <uilianries@gmail.com>
@uilianries uilianries requested a review from memsharded March 10, 2025 10:42
@czoido czoido added this to the 2.14 milestone Mar 10, 2025
memsharded added a commit to conan-io/conan that referenced this pull request Mar 10, 2025
#### Motivation

Hello!

This PR brings a new hooks for
[validate()](https://docs.conan.io/2/reference/conanfile/methods/validate.html)
methods

The intention is to help CI services validate a build without touching
the recipe, by adding an extra layer of validations. For instance, the
CI environment could not build a determined package due to custom
settings, or some system library is not available because the O.S. is
too old.

#### Details

The `validate` don't have a specific command, like export or build, so I
used `conan create` to get a ride and check if is working.

Also, the method is not defined by default, which means, **the hook will
only run when this method is defined in the recipe**.

**EDIT**: This PR originally covered `validate_build` too, but the PR
scope is now reduced to only cover `validate`. See the thread
#17856 (comment)

### Automation

Changelog: Feature: Add hooks for validate method: pre_validate and
post_validate
Docs: conan-io/docs#4013

/cc @jcar87 

- [ ] Refer to the issue that supports this Pull Request.
- [x] If the issue has missing info, explain the purpose/use
case/pain/need that covers this Pull Request.
- [x] I've read the [Contributing
guide](https://github.com/conan-io/conan/blob/develop2/.github/CONTRIBUTING.md).
- [x] I've followed the PEP8 style guides for Python code.
- [x] I've opened another PR in the Conan docs repo to the ``develop``
branch, documenting this one.
@czoido czoido merged commit 6acc3ad into conan-io:develop2 Mar 11, 2025
2 checks passed
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.

2 participants