Configuration

Divekit uses a hierarchical configuration system with both global and project-specific settings.

Divekit uses a hierarchical configuration system with both global and project-specific settings.

Configuration Levels

Divekit uses a multi-level configuration system based on the frequency of changes:

[0] Installation

Configurations that are set once during DiveKit installation and rarely changed afterwards. These contain global defaults and environment settings.

~
└── .divekit/
    β”œβ”€β”€ .env                  # Environment variables
    β”œβ”€β”€ hosts.json            # Hosts configuration
    β”œβ”€β”€ members               # Members configuration
    β”‚   β”œβ”€β”€ 2025-01-21_12-28-15_pear_members.json
    β”‚   β”œβ”€β”€ 2025-01-27_12-29-00_raspberry_members.json
    β”‚   └── 2025-01-27_12-40-02_sandwich_members.json
    β”œβ”€β”€ origin.json           # Origin configuration
    └── variation             # Variation configuration (not finalized)
        β”œβ”€β”€ relations.json    # Relations configuration
        β”œβ”€β”€ variableExtensions.json # Variable extensions configuration
        └── variations.json     # Variations configuration

Environment Configuration

~/.divekit/.env:

API_TOKEN=YOUR_ACCESS_TOKEN
DEFAULT_BRANCH=main

Remotes

Default: ~/.divekit/hosts.json:

{
    "version": "1.0",
    "hosts": {
        "default": {
            "host": "https://gitlab.git.nrw/",
            "token": "DIVEKIT_API_TOKEN"
        }
    }
}

Example: ~/.divekit/hosts.json:

{
    "version": "1.0",
    "hosts": {
        "default": {
            "host": "https://gitlab.git.nrw/",
            "tokenAt": "DIVEKIT_API_TOKEN"
        },
        "archilab": {
            "host": "https://gitlab.archi-lab.io/",
            "tokenAt": "DIVEKIT_API_TOKEN_ARCHILAB"
        },
        "gitlab": {
            "host": "https://gitlab.com/",
            "tokenAt": "DIVEKIT_API_TOKEN_GITLABCOM"
        }
    }
}

[1] Semester

Configurations that are typically set at the beginning of each semester. These define course-wide settings and distribution templates.

{ORIGIN_DIR}
└── .divekit/                 # Project configuration
    └── distributions/        
        β”œβ”€β”€ ST1-M1/           # Sandbox environment config
        β”‚   └── config.json   # Distribution settings
        └── ST1-M2/           # Student environment config
            └── config.json   # Distribution settings

Distribution Configuration (Version 2.0)

{ORIGIN}/.divekit/distributions/<distribution>/config.json:

{
  "version": "2.0",
  "remote": "default",
  "groupId": 12345,
  "name": "assignment-{{uuid}}",
  "members": {
    "path": "$DIVEKIT_MEMBERS/members.json",
    "permissions": "developer"
  },
  "securePipeline": {
    "enabled": true,
    "groupId": 67890
  }
}

Key Changes in Version 2.0:

  • Flat Structure: Removed nested targets object for simpler configuration
  • Secure Pipeline: Optional securePipeline object replaces separate test target
  • Simplified Members: Direct path reference instead of complex group structure
  • Automatic Linking: Repository linking is handled automatically during distribution

[2] Milestone

Configurations that change with each milestone or assignment. These include specific repository settings and member assignments.

{ORIGIN_DIR}
└── .divekit/
    └── distributions/
        └── <distribution>/   # e.g. ST1-M1
            └── config.json   # Milestone-specific settings

Members Configuration

Members are configured in a simple JSON file referenced by the distribution configuration:

members.json:

{
  "members": [
    {"username": "tbuck", "name": "Torben Buck"},
    {"username": "ada", "name": "Ada Lovelace"},
    {"username": "charles", "name": "Charles Babbage"},
    {"username": "jobs", "name": "Steve Jobs"},
    {"username": "woz", "name": "Steve Wozniak"}
  ]
}

Alternative CSV Format:

username,name
tbuck,Torben Buck
ada,Ada Lovelace
charles,Charles Babbage
jobs,Steve Jobs
woz,Steve Wozniak

The members file is referenced in the distribution configuration using the $DIVEKIT_MEMBERS environment variable:

{
  "members": {
    "path": "$DIVEKIT_MEMBERS/members.json",
    "permissions": "developer"
  }
}

[3] 🚧 Call

Configurations that can be overridden during command execution. Any configuration value from the previous levels can be overridden using command-line arguments.

Examples:

# Specify individual files for patching
divekit patch --distribution="sandbox" src/main/java/Exercise.java src/test/java/ExerciseTest.java

# set debug loglevel
divekit patch --loglevel=debug