Skip to content

feat(web): add assignmentUrls query for per-student/group repo URLs#101

Merged
obcode merged 1 commit into
mainfrom
feat/web-assignment-urls
Jul 18, 2026
Merged

feat(web): add assignmentUrls query for per-student/group repo URLs#101
obcode merged 1 commit into
mainfrom
feat/web-assignment-urls

Conversation

@obcode

@obcode obcode commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Erste read-only GitLab-nahe Operation für glabs-web (Milestone B). Sie ist rein aus der aufgelösten Kurs-Config abgeleitet — kein GitLab-Token, kein API-Call — daher voll testbar und gefahrlos vor den token-gestützten Operationen exponierbar.

Was drin ist

  • config: RepoURLs() (je Studierende/Gruppe For + URL) aus der druckenden Urls-Methode herausgezogen, sodass CLI und Web eine Implementierung teilen. Urls druckt jetzt darüber (identische Ausgabe). Neuer Helfer studentLabel (E-Mail, sonst Username/Raw/Id).
  • web/app: AssignmentURLs löst das Assignment aus den gespeicherten Bytes auf (genau wie Assignment) und liefert die Gruppen-URL plus je einen Eintrag pro Studierende/Gruppe. Gibt nil (kein Fehler) zurück, wenn es das Assignment nicht gibt oder es nicht auflösbar ist (z. B. abstrakte Basis).
  • graph: Typen AssignmentUrls/RepoUrl, Query assignmentUrls(course, name), Resolver + Mapping (gqlgen regeneriert).
  • Tests: RepoURLs (config, Student-Label-Fallback + per-group) und AssignmentURLs (app: per-student, fehlendes Assignment, abstrakte Basis).

GraphQL

assignmentUrls(course: String!, name: String!): AssignmentUrls
type AssignmentUrls { per: String!  groupUrl: String!  repos: [RepoUrl!]! }
type RepoUrl { for: String!  url: String! }

Verifikation (lokal grün)

go build ./..., go vet ./..., go vet -tags=integration ./..., go test ./..., golangci-lint run — alle sauber; gofmt clean.

Nächster Schritt: das GUI konsumiert assignmentUrls und zeigt die Repo-Links auf der Assignment-Seite (separater glabs.gui-PR).

🤖 Generated with Claude Code

First read-only GitLab-adjacent operation for glabs-web (Milestone B). It is
derived purely from the resolved course config — no GitLab token or API call —
so it is fully testable and safe to expose before the token-backed operations.

- config: extract RepoURLs() (For + URL per student/group) from the printing
  Urls method, so the CLI and the web share one implementation; add studentLabel
  (email, else username/raw/id).
- web/app: AssignmentURLs resolves the assignment from the stored bytes (exactly
  like Assignment) and returns the group URL plus one entry per student/group;
  returns nil for a missing or unresolvable (e.g. abstract) assignment.
- graph: AssignmentUrls/RepoUrl types + assignmentUrls query, resolver, mapping.
- tests for RepoURLs (config) and AssignmentURLs (app, incl. abstract/missing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@obcode
obcode merged commit 93cef4d into main Jul 18, 2026
8 checks passed
@obcode
obcode deleted the feat/web-assignment-urls branch July 18, 2026 14:26
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.

1 participant