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

Use mirror repo for unit tests to avoid need for credentials #22

Open
Vinai opened this issue Jan 14, 2021 · 9 comments
Open

Use mirror repo for unit tests to avoid need for credentials #22

Vinai opened this issue Jan 14, 2021 · 9 comments

Comments

@Vinai
Copy link

Vinai commented Jan 14, 2021

The unit test build requires setting secrets.MAGENTO_MARKETPLACE_USERNAME and secrets.MAGENTO_MARKETPLACE_PASSWORD.

For myself as the maintainer that is not a problem, but it means I have to ask every contributor to set up the secrets when they open a PR...
I'm just wondering, shouldn't it be possible to execute the build without the credentials, since it also works for the integration test build?

@Vinai
Copy link
Author

Vinai commented Jan 14, 2021

I just found --repository=https://repo-magento-mirror.fooman.co.nz/ is used for the integration test build, but not for the unit test build.
Is there a reason to stick with the "official" repo for the unit tests?

@Vinai
Copy link
Author

Vinai commented Jan 14, 2021

By the way, THANK YOU @fooman for setting up the mirror!

@Vinai Vinai changed the title Why does the integration build work without credentials but not the unit test build? Use mirror repo for unit tests to avoid need for credentials Jan 18, 2021
@jissereitsma
Copy link
Contributor

jissereitsma commented Jan 27, 2021

I think this is just work in progress. The first step into improving things was to add secrets, so that the secrets could be used in different actions - this is what I'm using already, but indeed, the secrets will not work with Pull Requests :( For that matter, there is no way to share an environment variable ("secret") with others than the contributors of the project.

However, the thing that you bump into is more a flaw in the documentation, than the actual workflow files. In the docs, it is mentioned to use the following snippet:

jobs:
    env:
          MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }}
          MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }}

But it is quite common that people fill in the details differently. The dependency in the workflow files is with the environment variable. The way to fill in that environment variable - for instance, using secrets or hard-coded - is up to you. (Obviously, hard-coded is not pretty.)

jobs:
    env:
          MAGENTO_MARKETPLACE_USERNAME: foo
          MAGENTO_MARKETPLACE_PASSWORD: bar

But you already changed the topic: Why not use the mirror? Good point - I see no reason not to. I'm going to fix that right away. Ideally, with a switch REPOSITORY_URL which defaults to https://repo-magento-mirror.fooman.co.nz/.

@jissereitsma
Copy link
Contributor

Done.

@Vinai
Copy link
Author

Vinai commented Jan 28, 2021

Awesome, thanks @jissereitsma. This should make it easier to use for open source modules.

@Vinai
Copy link
Author

Vinai commented Jan 28, 2021

Cam this issue be closed?

@fooman
Copy link
Contributor

fooman commented Jan 28, 2021

Let's keep it open for the moment. I'd like to take a look at pre-seeding the Composer cache for the mirror repo.

@fooman
Copy link
Contributor

fooman commented Jan 28, 2021

Am still also considering pre-building images to effectively jump straight to here
https://github.com/extdn/github-actions-m2/blob/master/magento-unit-tests/entrypoint.sh#L31
(could be done for integration tests too, but should stop before the set up step)

@jissereitsma
Copy link
Contributor

@fooman As of yet, all is working fine with this change. Can we close this issue?

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

3 participants