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

Add -t option to populate managed modules using GitHub's repository topics #158

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joestump
Copy link
Contributor

@joestump joestump commented Oct 4, 2018

GitHub supports tagging repositories with "topics". This PR leverages this functionality to populate a list of managed modules rather than having to manually maintain managed_modules.yml.

This allows teams to add the topic ruby to a GitHub repository and then use the -t ruby option in their Ruby Modulesync CI/CD job to grab all of the repositories to sync.

Copy link
Member

@ekohl ekohl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I do like the feature.

def self.managed_modules(config_file, filter, negative_filter, topic)
if topic
managed_modules = []
GITHUB.org_repos(GITHUB_ORGANIZATION).each do |repo|
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if managed_modules = GITHUB.org_repos(GITHUB_ORGANIZATION).filter { |r| r.topics.include?(topic) }.map(&:name) is easier to read

end

GITHUB = Octokit::Client.new(:access_token => GITHUB_TOKEN)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about a global with state. Perhaps it should be a lazy (static) method on the module. This can help in case it's used in an offline context.

@bittner
Copy link
Contributor

bittner commented Mar 19, 2019

Interesting! This sounds like driven by the same idea we had for managing GitLab projects with their projects topics. 👍

See our Python CLI package concierge-cli on PyPI for reference.

neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 21, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 21, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 21, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 22, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 23, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 23, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 23, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Apr 23, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
@neomilium neomilium mentioned this pull request Apr 23, 2021
neomilium added a commit to opus-codium/modulesync that referenced this pull request Oct 5, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Oct 6, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
neomilium added a commit to opus-codium/modulesync that referenced this pull request Oct 6, 2021
This commit renames ModuleSync::PR module to ModuleSync::GitService.

Git service classes (ie. GitHub and GitLab) can now be used to implement
more features than PR/MR opening. (e.g voxpupuli#158)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants