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

Allow uploading from MR/PRs #564

Open
skycaptain opened this issue May 10, 2021 · 1 comment
Open

Allow uploading from MR/PRs #564

skycaptain opened this issue May 10, 2021 · 1 comment

Comments

@skycaptain
Copy link
Contributor

Description of Problem, Request, or Question

I'm trying to use CPT from a Giltab CI pipeline where Conan packages are uploaded to an Artifactory instance. My pipelines also uses rules to define the behaviour for default, feature and release branches. Conan's docs suggest to setup three repositories: release for released packages, develop for master/main/trunk/stable packages and build for feature branch artifacts or everything else, ie. MR/PR pipelines. However, when trying to upload conan packages from a MR pipeline, I'm getting the following:

Skipping upload, this is a Pull Request

I have CONAN_UPLOAD and the following settings set:

| upload_only_when_stable   | False                                                      |
| upload_only_when_tag      | False                                                      |
| upload_only_recipe        | False                                                      |
| upload_force              | True                                                       |
| stable_branch_pattern     | release/*                                                  |
| stable_channel            | stable                                                     |
| channel                   | testing                                                    |
| upload_dependencies       | all     

This seems to be lines preventing the upload

if not os.getenv("CONAN_TEST_SUITE", False):
    if self.ci_manager.is_pull_request():
        # PENDING! can't found info for gitlab/bamboo
        self.printer.print_message("Skipping upload, this is a Pull Request")
        return False

My understanding is that if an upload remote is given, CPT should not prevent uploading, especially when sth. like upload_force is set to true. It seems like one way to circumvent that check is to set CONAN_TEST_SUITE. But, if I'm not mistaken that's an internal variable for your test suite and hence not public, right? There seems no documentation of this variable.

How can I enforce uploading packages from a MR?

Environment Details

  • Conan Package Tools Version: 0.35.1
  • Operating System: Linux
  • Operation System Version: Debian Buster
  • Docker image: custom
  • Conan version: conan 1.35.2
  • Python version: python 3.7.3

Steps to reproduce (Include if Applicable)

Build logs (Include if Available)

@Hopobcn
Copy link

Hopobcn commented Jul 23, 2021

Unfortunately upload_force just controls --force parameter of conan upload. Doesn't has anything to do with CPT. (I fell to the same pitfall).

Maybe upload_force should override (most) checks of

def _upload_enabled(self):

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

No branches or pull requests

2 participants