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

Organization #102

Merged
merged 9 commits into from
Oct 19, 2024
Merged

Conversation

RodrigoMNardi
Copy link
Collaborator

@RodrigoMNardi RodrigoMNardi commented Oct 9, 2024

This PR introduces a console script for managing Organization and GithubUser records in the NetDEF CI System. The script provides functionalities to find, create, edit organizations, and manage the association between GitHub users and organizations.

Key Features

  • Find Organization: Search for an organization by name.
  • Create Organization: Create a new organization with specified attributes.
  • Edit Organization: Update the attributes of an existing organization.
  • Find GitHub User: Search for a GitHub user by login.
  • Add User to Organization: Link a GitHub user to an organization.
  • Remove User from Organization: Unlink a GitHub user from an organization.
  • Link GitHub account and Slack account

Available Commands

  • find_organization(name)

  • create_organization(name, attributes = {})

  • edit_organization(name, attributes = {})

  • find_github_user(login)

  • add_user_in_organization(login, organization_name)

  • remove_user_from_organization(login)

  • add_github_user_slack_user(github_login, slack_user)

  • Attributes for create_organization / edit_organization

  • contact_email: string

  • contact_name: string

  • url: string

Examples

  • find_organization('NetDEF')
  • create_organization('NetDEF', contact_name: 'Rodrigo Nardi')
  • edit_organization('NetDEF', contact_name: 'Martin Winter')
  • find_github_user('rodrigonardi')
  • add_user_in_organization('rodrigonardi', 'NetDEF')
  • remove_user_from_organization('rodrigonardi')

Additional Information

This script initializes the environment, defines methods for interacting with the Organization and GithubUser models, and starts an IRB console for executing these commands interactively.

** Usage **

./bin/console

Creating a console to create, edit and link githubuser and organization

Signed-off-by: Rodrigo Nardi <[email protected]>
Updating schema

Signed-off-by: Rodrigo Nardi <[email protected]>
Adding no coverage in inspect method

Signed-off-by: Rodrigo Nardi <[email protected]>
@mwinter-osr
Copy link
Member

please add slack userid and email as additional fields to the database

Adding details about slack account

Signed-off-by: Rodrigo Nardi <[email protected]>
Adding details about slack account

Signed-off-by: Rodrigo Nardi <[email protected]>
@RodrigoMNardi
Copy link
Collaborator Author

please add slack userid and email as additional fields to the database

I added the command to relate to GitHub login and Slack ID.

add_github_user_slack_user(github_login, slack_user)

Example: add_github_user_slack_user('mwinter-osr', 'mwinter')

Updating rubocop to ignore the console

Signed-off-by: Rodrigo Nardi <[email protected]>
Making slack bot less verbose

Signed-off-by: Rodrigo Nardi <[email protected]>
Removing unless code

Signed-off-by: Rodrigo Nardi <[email protected]>
Adding unit tests

Signed-off-by: Rodrigo Nardi <[email protected]>
@RodrigoMNardi RodrigoMNardi merged commit 38fe0b2 into FRRouting:master Oct 19, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants