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

MNT Remove redundant commands #254

Merged
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
39 changes: 2 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,48 +168,13 @@ information:
- `{{ logs }}` will inject the commit logs with before/after delimiters, so they can be updated later without destroying
any other changes to the contents.

## Synchronising data to supported modules
## GitHub API ratelimit

Cow includes commands to help synchronise standardised data to all
[commercially supported modules](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/):

* `cow github:synclabels` Pushes a centralised list of labels to all supported module GitHub repositories
* `cow github:ratelimit` Check your current GitHub API rate limiting status (sync commands can use this up quickly)
Run `cow github:ratelimit` to check your current GitHub API rate limiting status

**Note:** All GitHub API commands require a `GITHUB_ACCESS_TOKEN` environment variable to be set before they can be
used. It can be in the .env file (see [dev mode](#dev_mode)).

### Labels

[Centralised label configuration](https://github.com/silverstripe/supported-modules/blob/gh-pages/labels.json) can be
pushed out to all [supported modules](https://github.com/silverstripe/supported-modules/blob/gh-pages/modules.json)
using the `cow github:synclabels` command.

This command takes an optional argument to specify which module(s) to update:

* `modules` Optionally sync to specific modules (comma delimited)

If the `modules` argument is not provided, the list of supported modules will be loaded from the `supported-modules`
GitHub repository. You can then confirm the list, before you will be shown a list of the labels that will be sync'd
and finally all labels will either be created or updated on the target repositories.

This command can max out your GitHub API rate limiting credits, so use it sparingly. If you exceed the limit you may
need to go and make a coffee and come back in an hour (check current rate limits with `cow github:ratelimit`).

### Metadata files

[File templates](https://github.com/silverstripe/supported-modules/tree/gh-pages/templates) for supported modules can
be synchronised out to all supported modules using the `module:sync:metadata` command.

This command will pull the latest version from the supported-modules repository, write the contents to each repository
then stage, commit and push directly to the default branch.

This command takes an optional argument to skip the clone/pull of each repository beforehand:

* `--skip-update` Optionally skip the clone/fetch/pull for each repository before running the sync

You will need `git` available in your system path, as well as write permission to push to each repository.

## Schema

The [cow schema file](cow.schema.json) is in the root of this project.
Expand Down
6 changes: 0 additions & 6 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SilverStripe\Cow;

use SilverStripe\Cow\Commands;
use SilverStripe\Cow\Utility\SupportedModuleLoader;
use SilverStripe\Cow\Utility\Config;
use SilverStripe\Cow\Utility\GitHubApi;
use SilverStripe\Cow\Utility\Twig;
Expand Down Expand Up @@ -92,7 +91,6 @@ protected function getDefaultCommands(): array

// Create dependencies
$githubApi = new GitHubApi();
$supportedModuleLoader = new SupportedModuleLoader();

// What is this cow doing in here, stop it, get out
$commands[] = new Commands\MooCommand();
Expand All @@ -112,15 +110,11 @@ protected function getDefaultCommands(): array
$commands[] = new Commands\Release\Release();
$commands[] = new Commands\Release\Publish();

// Module commands
$commands[] = new Commands\Module\Sync\Metadata($supportedModuleLoader);

// Schema commands
$commands[] = new Commands\Schema\Validate();

// GitHub commands
$commands[] = new Commands\GitHub\RateLimit($githubApi);
$commands[] = new Commands\GitHub\SyncLabels($supportedModuleLoader, $githubApi);

return $commands;
}
Expand Down
226 changes: 0 additions & 226 deletions src/Commands/GitHub/SyncLabels.php

This file was deleted.

Loading
Loading