Skip to content

feat: add merge request checks, see #54#57

Merged
obcode merged 1 commit into
mainfrom
feature/merge_checks
Apr 23, 2026
Merged

feat: add merge request checks, see #54#57
obcode merged 1 commit into
mainfrom
feature/merge_checks

Conversation

@obcode

@obcode obcode commented Apr 23, 2026

Copy link
Copy Markdown
Owner

No description provided.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 23, 2026 19:06
@github-actions

Copy link
Copy Markdown
Contributor

Coverage

github.com/obcode/glabs/cmd/archive.go:12:		init				100.0%
github.com/obcode/glabs/cmd/check.go:10:		init				100.0%
github.com/obcode/glabs/cmd/clone.go:45:		init				100.0%
github.com/obcode/glabs/cmd/delete.go:12:		init				100.0%
github.com/obcode/glabs/cmd/generate.go:12:		init				100.0%
github.com/obcode/glabs/cmd/protect.go:12:		init				100.0%
github.com/obcode/glabs/cmd/report.go:14:		init				100.0%
github.com/obcode/glabs/cmd/root.go:39:			Execute				0.0%
github.com/obcode/glabs/cmd/root.go:43:			init				100.0%
github.com/obcode/glabs/cmd/root.go:51:			er				0.0%
github.com/obcode/glabs/cmd/root.go:56:			initConfig			0.0%
github.com/obcode/glabs/cmd/setaccess.go:12:		init				100.0%
github.com/obcode/glabs/cmd/show.go:8:			init				100.0%
github.com/obcode/glabs/cmd/update.go:12:		init				100.0%
github.com/obcode/glabs/cmd/urls.go:22:			init				100.0%
github.com/obcode/glabs/cmd/version.go:10:		init				100.0%
github.com/obcode/glabs/config/assignment.go:11:	String				100.0%
github.com/obcode/glabs/config/assignment.go:24:	GetAssignmentConfig		85.7%
github.com/obcode/glabs/config/assignment.go:74:	RepoSuffix			100.0%
github.com/obcode/glabs/config/assignment.go:88:	RepoBaseName			100.0%
github.com/obcode/glabs/config/assignment.go:96:	RepoNameWithSuffix		100.0%
github.com/obcode/glabs/config/assignment.go:100:	RepoNameForStudent		100.0%
github.com/obcode/glabs/config/assignment.go:104:	RepoNameForGroup		100.0%
github.com/obcode/glabs/config/assignment.go:108:	assignmentPath			100.0%
github.com/obcode/glabs/config/assignment.go:122:	per				100.0%
github.com/obcode/glabs/config/assignment.go:129:	description			100.0%
github.com/obcode/glabs/config/assignment.go:139:	mergeRequest			83.3%
github.com/obcode/glabs/config/course.go:14:		GetCourseConfig			50.0%
github.com/obcode/glabs/config/release.go:8:		release				100.0%
github.com/obcode/glabs/config/release.go:22:		releaseMergeRequest		100.0%
github.com/obcode/glabs/config/release.go:46:		dockerImages			100.0%
github.com/obcode/glabs/config/repo.go:8:		startercode			92.6%
github.com/obcode/glabs/config/repo.go:65:		clone				100.0%
github.com/obcode/glabs/config/repo.go:87:		SetBranch			100.0%
github.com/obcode/glabs/config/repo.go:91:		SetProtectToBranch		100.0%
github.com/obcode/glabs/config/repo.go:98:		SetLocalpath			100.0%
github.com/obcode/glabs/config/repo.go:102:		SetForce			100.0%
github.com/obcode/glabs/config/seeder.go:15:		seeder				53.8%
github.com/obcode/glabs/config/show.go:10:		Show				100.0%
github.com/obcode/glabs/config/students.go:14:		SetAccessLevel			100.0%
github.com/obcode/glabs/config/students.go:28:		accessLevel			100.0%
github.com/obcode/glabs/config/students.go:43:		students			100.0%
github.com/obcode/glabs/config/students.go:75:		mkStudents			94.4%
github.com/obcode/glabs/config/students.go:108:		groups				100.0%
github.com/obcode/glabs/config/urls.go:5:		Urls				100.0%
github.com/obcode/glabs/git/auth.go:11:			GetAuth				90.0%
github.com/obcode/glabs/git/clone.go:18:		Clone				80.0%
github.com/obcode/glabs/git/clone.go:38:		cloneurl			100.0%
github.com/obcode/glabs/git/clone.go:44:		localpath			100.0%
github.com/obcode/glabs/git/clone.go:48:		clone				36.1%
github.com/obcode/glabs/git/starterrepo.go:22:		PrepareStartercodeRepo		0.0%
github.com/obcode/glabs/gitlab/archive.go:14:		Archive				77.8%
github.com/obcode/glabs/gitlab/archive.go:32:		archivePerStudent		90.9%
github.com/obcode/glabs/gitlab/archive.go:54:		archivePerGroup			90.9%
github.com/obcode/glabs/gitlab/archive.go:76:		archive				75.6%
github.com/obcode/glabs/gitlab/check.go:9:		CheckCourse			90.6%
github.com/obcode/glabs/gitlab/check.go:67:		checkStudent			100.0%
github.com/obcode/glabs/gitlab/check.go:89:		checkDupsInGroups		100.0%
github.com/obcode/glabs/gitlab/delete.go:11:		Delete				77.8%
github.com/obcode/glabs/gitlab/delete.go:29:		deletePerStudent		100.0%
github.com/obcode/glabs/gitlab/delete.go:40:		deletePerGroup			100.0%
github.com/obcode/glabs/gitlab/delete.go:51:		delete				92.9%
github.com/obcode/glabs/gitlab/generate.go:14:		Generate			38.9%
github.com/obcode/glabs/gitlab/generate.go:51:		generate			0.0%
github.com/obcode/glabs/gitlab/generate.go:213:		generatePerStudent		0.0%
github.com/obcode/glabs/gitlab/generate.go:226:		generatePerGroup		0.0%
github.com/obcode/glabs/gitlab/gitlab.go:13:		NewClient			80.0%
github.com/obcode/glabs/gitlab/groups.go:12:		getGroupIDByFullPath		100.0%
github.com/obcode/glabs/gitlab/groups.go:33:		getGroupID			100.0%
github.com/obcode/glabs/gitlab/groups.go:46:		createGroup			83.3%
github.com/obcode/glabs/gitlab/issues.go:14:		getStartercodeProject		100.0%
github.com/obcode/glabs/gitlab/issues.go:58:		replicateIssue			100.0%
github.com/obcode/glabs/gitlab/projects.go:12:		generateProject			77.5%
github.com/obcode/glabs/gitlab/projects.go:97:		getProjectByName		80.0%
github.com/obcode/glabs/gitlab/protect.go:14:		ProtectToBranch			77.8%
github.com/obcode/glabs/gitlab/protect.go:32:		protectBranch			56.1%
github.com/obcode/glabs/gitlab/protect.go:134:		protectSingleBranch		100.0%
github.com/obcode/glabs/gitlab/protect.go:169:		protectToBranchPerStudent	90.9%
github.com/obcode/glabs/gitlab/protect.go:191:		protectToBranchPerGroup		72.7%
github.com/obcode/glabs/gitlab/report.go:14:		Report				78.9%
github.com/obcode/glabs/gitlab/report.go:51:		ReportHTML			73.7%
github.com/obcode/glabs/gitlab/report.go:86:		ReportJSON			77.8%
github.com/obcode/glabs/gitlab/report_helper.go:17:	report				82.5%
github.com/obcode/glabs/gitlab/report_helper.go:135:	projectReport			85.9%
github.com/obcode/glabs/gitlab/seeder.go:21:		localpath			0.0%
github.com/obcode/glabs/gitlab/seeder.go:25:		runSeeder			0.0%
github.com/obcode/glabs/gitlab/seeder.go:100:		addAndCommit			0.0%
github.com/obcode/glabs/gitlab/seeder.go:121:		push				0.0%
github.com/obcode/glabs/gitlab/setaccess.go:14:		Setaccess			77.8%
github.com/obcode/glabs/gitlab/setaccess.go:32:		setaccess			41.5%
github.com/obcode/glabs/gitlab/setaccess.go:140:	inviteByEmail			100.0%
github.com/obcode/glabs/gitlab/setaccess.go:155:	setaccessPerStudent		100.0%
github.com/obcode/glabs/gitlab/setaccess.go:175:	setaccessPerGroup		80.0%
github.com/obcode/glabs/gitlab/starterrepo.go:14:	pushStartercode			0.0%
github.com/obcode/glabs/gitlab/starterrepo.go:110:	devBranch			0.0%
github.com/obcode/glabs/gitlab/update.go:15:		Update				60.0%
github.com/obcode/glabs/gitlab/update.go:44:		update				31.6%
github.com/obcode/glabs/gitlab/update.go:91:		updatePerStudent		100.0%
github.com/obcode/glabs/gitlab/update.go:111:		updatePerGroup			100.0%
github.com/obcode/glabs/gitlab/users.go:12:		getUser				95.0%
github.com/obcode/glabs/gitlab/users.go:49:		getUserID			100.0%
github.com/obcode/glabs/gitlab/users.go:63:		addMember			94.1%
github.com/obcode/glabs/main.go:18:			main				0.0%
total:							(statements)			65.7%

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds configurable GitLab “merge request checks” to generated projects, controlled via mergeRequest configuration keys (see #54), and updates tests/docs accordingly.

Changes:

  • Extend config.MergeRequest with booleans for merge checks and parse them from Viper config.
  • Apply these merge-check settings when creating GitLab projects via CreateProjectOptions.
  • Update CLI output (Show()), docs, and add/extend tests covering parsing, display, and GitLab request payloads.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
gitlab/projects.go Passes merge-check booleans into GitLab project creation options.
gitlab/projects_contract_test.go Contract test asserting merge-check fields are present in the create-project request body.
config/types.go Adds merge-check boolean fields to MergeRequest.
config/assignment.go Reads merge-check booleans from config (mergeRequest.*) into MergeRequest.
config/assignment_test.go Tests default false values and config-driven true values for merge checks.
config/show.go Displays merge-check settings in Show() output.
config/urls_show_test.go Adds Show() output test coverage for the new merge-check fields.
docs/getting-started.md Documents default values for new mergeRequest.* keys.
docs/configuration.md Documents new merge-check keys and includes them in examples.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config/show.go
Comment on lines 30 to +48
mergeRequestCfg := aurora.Sprintf(aurora.Cyan(`
%s %s
%s %s`),
%s %s
%s %s
%s %t
%s %t
%s %t
%s %t`),
aurora.Cyan("MergeMethod:"),
aurora.Yellow(mergeMethod),
aurora.Cyan("SquashOption:"),
aurora.Yellow(squashOption),
aurora.Cyan("PipelineMustSucceed:"),
aurora.Yellow(pipelineMustSucceed),
aurora.Cyan("SkippedPipelinesAreSuccessful:"),
aurora.Yellow(skippedPipelinesAreSuccessful),
aurora.Cyan("AllThreadsMustBeResolved:"),
aurora.Yellow(allThreadsMustBeResolved),
aurora.Cyan("StatusChecksMustSucceed:"),
aurora.Yellow(statusChecksMustSucceed),

Copilot AI Apr 23, 2026

Copy link

Choose a reason for hiding this comment

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

The format string uses %t for the merge-check values, but the arguments passed are aurora.Yellow(<bool>) (an aurora.Value), not a bool. This will render as %!t(...) and likely breaks Show() output (and the new test). Use %s (and keep coloring), or keep %t but pass the raw bools (and optionally colorize via aurora.Sprintf/string conversion).

Copilot uses AI. Check for mistakes.
@obcode obcode merged commit 5e8abcf into main Apr 23, 2026
14 checks passed
@obcode obcode deleted the feature/merge_checks branch April 23, 2026 19:10
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