-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing a Thor CLI task for managing RubyGems Gem administration
- Loading branch information
1 parent
13eef60
commit 47c73bf
Showing
18 changed files
with
1,243 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
Gemfile.lock | ||
.yardoc | ||
coverage | ||
doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
AllCops: | ||
Exclude: | ||
- 'script/**/*' | ||
|
||
Layout/LineLength: | ||
Exclude: | ||
- 'lib/samvera/git_hub.rb' | ||
- 'lib/samvera/org.rb' | ||
- 'spec/system/cli_spec.rb' | ||
|
||
Metrics/AbcSize: | ||
Exclude: | ||
- 'lib/samvera/gem_query_service.rb' | ||
- 'lib/samvera/org.rb' | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- 'Rakefile' | ||
- 'lib/samvera/gem_query_service.rb' | ||
- 'spec/system/cli_spec.rb' | ||
|
||
Metrics/MethodLength: | ||
Exclude: | ||
- 'lib/samvera/gem_query_service.rb' | ||
- 'lib/samvera/org.rb' | ||
|
||
Style/Documentation: | ||
Exclude: | ||
- 'lib/samvera.rb' | ||
- 'lib/samvera/gem_query_service.rb' | ||
- 'lib/samvera/git_hub.rb' | ||
- 'lib/samvera/org.rb' | ||
- 'lib/samvera/repository_query_service.rb' | ||
- 'lib/samvera/ruby_gems.rb' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Component Maintenance Interest Group | ||
## Command-Line Interface (CLI) Utility | ||
|
||
### Getting Started | ||
|
||
1. Get a personal access token from GitHub (https://github.com/settings/tokens) with the following scopes enabled: | ||
* `public_repo` | ||
* `read:org` | ||
* `user:email` | ||
1. Set an ENV variable named `GITHUB_SAMVERA_TOKEN` containing your token | ||
|
||
The CLI commands may then be listed using the following: | ||
|
||
```bash | ||
$ bundle exec thor list | ||
``` | ||
|
||
...yielding: | ||
|
||
```bash | ||
samvera | ||
------- | ||
thor samvera:org:add_owners # Ensure that all members of the administrator GitHub Team are Gem Owners for RubyGems entries | ||
thor samvera:org:admins # list members of the GitHub administrative Team | ||
thor samvera:org:contributors # list members of the GitHub administrative Team | ||
thor samvera:org:remove_owners # Ensure that all Gem Owners for RubyGems entries which are *not* members of the administrator ... | ||
thor samvera:org:repositories # list Samvera repositories | ||
``` | ||
|
||
### Queries | ||
|
||
One may retrieve the current GitHub administrators using the following: | ||
|
||
```bash | ||
$ bundle exec thor samvera:org:admins | ||
``` | ||
|
||
One may retrieve the current GitHub contributors using the following: | ||
|
||
```bash | ||
$ bundle exec thor samvera:org:contributors | ||
``` | ||
|
||
One may also retrieve the current GitHub repositories managing Ruby Gem projects using the following: | ||
|
||
```bash | ||
$ bundle exec thor samvera:org:repositories | ||
``` | ||
|
||
### Gem Management | ||
|
||
As an administrator, one may grant ownership privileges for RubyGems entries to all GitHub contributors using the following: | ||
|
||
```bash | ||
$ bundle exec thor samvera:org:add_owners | ||
``` | ||
|
||
As an administrator, one may revoke ownership privileges for RubyGems entries to owners who are neither GitHub contributors nor GitHub administrators using the following: | ||
|
||
```bash | ||
$ bundle exec thor samvera:org:remove_owners | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
source 'https://rubygems.org' | ||
|
||
gem 'github_api' | ||
gem 'huborg' | ||
gem 'rake' | ||
gem 'rake' | ||
gem 'thor' | ||
|
||
group :development do | ||
gem 'bixby' | ||
gem 'pry-byebug' | ||
gem 'rspec' | ||
gem 'simplecov' | ||
gem 'webmock' | ||
gem 'yard' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative 'lib/samvera' | ||
|
||
Samvera::Org.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
rubygems: | ||
gems: | ||
# [GitHub Repository]: [RubyGems Gem] | ||
active_fedora: active-fedora | ||
fcrepo-admin: fcrepo_admin | ||
questioning_authority: qa | ||
repositories: | ||
invalid: | ||
# samvera | ||
- cla-bot | ||
- cla-bot-old | ||
- hyku | ||
- maintenance | ||
- samvera-circleci-orb | ||
- samvera.github.io | ||
# samvera-labs | ||
- ActiveTriples | ||
- starter-react-component-npm | ||
- stencil-test-components | ||
- sufia.io | ||
- samvera-connect | ||
- samvera-labs.github.io | ||
- samvera-persona | ||
- samvera-virtual-connect | ||
- samvera.org | ||
- samvera_docs | ||
- serverless-iiif | ||
- sessionizer | ||
- uri_selection_wg | ||
- ValkyrieAPI | ||
- repository_utils | ||
- power-steering | ||
- openseadragon-react-viewer | ||
- nurax-pg | ||
- node-iiif | ||
- nectar-iiif | ||
- browse-everything-components | ||
- browse-everything-redux-react | ||
- iiif-image-api | ||
- iiif-react-media-player | ||
- hyku-api | ||
- hyku.github.io | ||
- docker-fcrepo | ||
- fcrepo-charts | ||
- fcrepo3 | ||
- fcrepo3-ldp | ||
- core-dependency-report | ||
- digital_collections_elixir_example | ||
- branch-renaming-wg | ||
- bloom-iiif | ||
- AdvancingHyku | ||
- ansible-sufia7-playbook | ||
- clover-iiif | ||
- houndstooth | ||
- image-downloader | ||
- allinson_flex | ||
- analytics_nurax | ||
- avalon-bundle | ||
- book_concerns | ||
- doi_registrar | ||
- hybox-ideas | ||
- hydra-admin-collections | ||
- hydra-shibboleth | ||
- hydra_controlled_vocabularies | ||
- hydra_documentation_wg | ||
- hydra_file_sets_wg | ||
- hydra_plugins_wg | ||
- hyrax-batch_ingest.. | ||
- hyrax-google_analytics | ||
- hyrax-hirmeos | ||
- hyrax-json_fields | ||
- hyrax-orcid | ||
- hyrax-speed_test | ||
- karmabot | ||
- open_annotation_models | ||
- rdf-proxy_list | ||
- ruby-oai | ||
- samvera-external_storage | ||
- samvera-shibboleth | ||
- sipity | ||
- speedy_af | ||
- storage_proxy_api | ||
- valkyrie-cloud_search | ||
- valkyrie-derivatives | ||
- valkyrie-dynamodb | ||
- valkyrie-redis | ||
- valkyrie_pg_demo | ||
- hyrax-batch_ingest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
github: | ||
owners: | ||
# [GitHub Account]: [RubyGems Account] | ||
aaron-collier: acollier | ||
billdueber: BillDueber | ||
carolyncole: cam156 | ||
hackartisan: HackmasterA | ||
jrgriffiniii: jrgriffiniii | ||
julesies: geekycoder | ||
no-reply: no_reply | ||
owners: | ||
invalid: | ||
- kelynch | ||
- mlooney | ||
- orangewolf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Samvera | ||
def self.relative_file_path | ||
File.dirname(__FILE__) | ||
end | ||
|
||
def self.absolute_file_path | ||
File.absolute_path(relative_file_path) | ||
end | ||
|
||
def self.root_path | ||
Pathname.new(absolute_file_path) | ||
end | ||
|
||
autoload(:GemQueryService, root_path.join('samvera', 'gem_query_service')) | ||
autoload(:RubyGems, root_path.join('samvera', 'ruby_gems')) | ||
autoload(:RepositoryQueryService, root_path.join('samvera', 'repository_query_service')) | ||
autoload(:GitHub, root_path.join('samvera', 'git_hub')) | ||
autoload(:Org, root_path.join('samvera', 'org')) | ||
end |
Oops, something went wrong.