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

ENH Allow developers to declare which packages are inaccessible. #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,25 @@ newer releases don't show up as expected. We recommend to have looser constraint
(e.g. `silverstripe/framework:^4.3`). When the "Latest" version shows `dev-master`,
it likely means that you have `"minimum-stability": "dev"` in your `composer.json`.

## Private repositories

While this module itself doesn't fetch information about repositories, other modules (such as the [update-checker](https://github.com/bringyourownideas/silverstripe-composer-update-checker)) do. If you have private repositories for which you are unable to provide authentication details to the respective module, you should mark those repositories as inaccessible.

This can be done either per repository:
```yml
BringYourOwnIdeas\Maintenance\Tasks:
inaccessible_packages:
- some-org/some-package-name
```

or for situations where you are hosting repositories yourself, per host:
```yml
BringYourOwnIdeas\Maintenance\Tasks:
inaccessible_repository_hosts:
- gitea.mycompany.com
```
This catches packages whether they're referenced by https or ssh URLs - for example, for `https://gitea.mycompany.com/some-org/some-package-name.git` and for `[email protected]:some-org/some-package-name.git`, the value should be `gitea.mycompany.com`.

## Documentation

Please see the [user guide](docs/en/userguide/index.md) section.
Expand Down
23 changes: 23 additions & 0 deletions src/Tasks/UpdatePackageInfoTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,29 @@ class UpdatePackageInfoTask extends BuildTask
'silverstripe-vendormodule',
];

/**
* A list of package names which composer will not be able to access
* e.g. private packages for which you aren't allowed to provide credentials.
*
* @config
* @var array
*/
private static $inaccessible_packages = [];

/**
* A list of repository hosts which composer will not be able to access
* e.g. private repository hosts for which you aren't allowed to provide credentials.
*
* This works for https AND ssh URLs - for example, for
* `https://gitea.mycompany.com/some-org/some-repository.git` and for
* `[email protected]:some-org/some-repository.git`, the value should be
* `gitea.mycompany.com`
*
* @config
* @var array
*/
private static $inaccessible_repository_hosts = [];

/**
* @var ComposerLoader
*/
Expand Down