This guide provides detailed instructions for integrating Factory with your self-hosted GitLab instance, allowing Factory’s Droids to securely access and work with your on-premise repositories.

Prerequisites

  • Admin access to your self-hosted GitLab instance
  • Network access between your GitLab instance and Factory’s AWS VPC
  • A Factory account with admin privileges

Integration Process

1

Initial Setup & Information Gathering

1

Create GitLab Application

  1. In your GitLab instance, go to Admin Area > Applications.
  2. Click “New application” and fill in the details:
    • Name: “Factory Integration”
    • Redirect URI: (Provided by Factory)
    • Scopes: Select all necessary scopes (detailed in “Required Permissions” section)
  3. Save the application and note down the Application ID and Secret.
2

Collect Integration Information

Gather the following details:

  • Application ID
  • Application Secret
  • Your GitLab instance URL
  • A personal access token with admin rights
3

Submit Information to Factory

Securely send the collected information to your Factory representative.

2

Network Security Configuration

1

Evaluate Network Policy

Review your current network security policies to identify potential connectivity barriers with Factory’s AWS VPC.

2

Establish Connectivity

Choose one of the following methods:

  1. VPC Peering (if your GitLab is on AWS):
    • Initiate a VPC peering request.
    • Exchange VPC IDs with Factory.
    • Configure route tables for direct network routes.
  2. VPN Connection:
    • Establish a VPN between your network and Factory’s.
    • Ensure VPN settings (e.g., IPsec) are compatible on both ends.
3

Firewall Configuration

  • Allow outbound connections to Factory’s services (HTTPS and SSH traffic).
  • Ensure your GitLab instance can communicate with Factory’s webhook endpoint.
3

Webhook Setup

1

Create Webhook

In your GitLab instance settings, create a new webhook:

  • URL: (Provided by Factory)
  • Secret Token: (Provided by Factory)
  • Trigger on: Pushes, Comments, Merge Requests, Issues, CI/CD events
2

Test Webhook

Use GitLab’s “Test” feature to ensure the webhook is properly configured.

4

Required Permissions

Ensure the GitLab application has the following scopes:

  • api (Full API access)
  • read_user (Read user information)
  • read_repository (Read repository information)
  • write_repository (Write to repositories)
  • read_registry (Read container registry)
  • sudo (Perform API actions as any user)
5

Testing and Validation

1

Preliminary Testing

Work with Factory to conduct initial tests of API connectivity and webhook functionality.

2

Comprehensive Testing

Test all GitLab events that trigger Droids within Factory, including:

  • Creating merge requests
  • Pushing code
  • Opening issues
  • Running CI/CD pipelines
3

Validation

Verify that Factory Droids respond correctly to these events.

6

Final Adjustments and Go-Live

1

Feedback and Adjustments

Provide feedback on any issues encountered during testing. Work with Factory to make necessary adjustments.

2

Go-Live

Agree on a go-live date with Factory.

3

Monitoring

Implement continuous monitoring for the initial days post-launch to quickly address any unforeseen issues.

Troubleshooting

  • If API calls fail, check your network configuration and firewall rules.
  • For permission-related issues, review the application settings and scopes in your GitLab instance.
  • If webhooks aren’t being received, verify the webhook URL and secret token.

Support

For any specific issues or detailed support needs, contact the Factory team through your designated support channel.

Security and Compliance

Learn about Factory’s security measures for enterprise integrations