Merged
Conversation
3 tasks
There was a problem hiding this comment.
Pull Request Overview
This PR adds comprehensive support for noticeboards functionality to the Classeviva CLI tool. The implementation follows a cleaner architectural pattern by breaking down the monolithic adapter into specialized receivers.
Key Changes:
- Introduced noticeboard features (list, mark as read, download attachments) with dedicated CLI commands
- Refactored the adapter architecture into specialized receivers (Agenda, Grades, Noticeboards) with a centralized SpaggiariClient
- Updated all mocks to use testify/mock v2.42.0 with improved initialization patterns
Reviewed Changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| adapters/spaggiari/spaggiari.go | Introduces centralized SpaggiariClient with shared Get/Post methods and factory function for creating adapters |
| adapters/spaggiari/noticeboards.go | Implements NoticeboardsReceiver interface with list, download, and mark-as-read functionality |
| adapters/spaggiari/agenda.go | Refactored agenda functionality into dedicated receiver using new Client interface |
| adapters/spaggiari/grades.go | Refactored grades functionality into dedicated receiver using new Client interface |
| adapters/spaggiari/model.go | Adds Noticeboard data structure with attachments support |
| commands/noticeboards.go | Implements list and download commands for noticeboards with table-formatted output |
| entrypoints/cli/cmd/noticeboards/ | Adds CLI command handlers for noticeboard list and download operations |
| mocks/ | Updates all mocks to v2.42.0 style with proper cleanup and new mock types for refactored interfaces |
| .tool-versions | Updates Go version to 1.25.1 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Add noticeboard support to list them and download the attachments.
Change description
Key changes:
- agenda.go - AgendaReceiver interface and implementation
- grades.go - GradesReceiver interface and implementation
- noticeboards.go - NoticeboardsReceiver interface and implementation (NEW)
- spaggiari.go - Centralized SpaggiariClient with Get/Post methods
- Listing noticeboards (adapters/spaggiari/noticeboards.go:18)
- Marking noticeboards as read (adapters/spaggiari/noticeboards.go:48)
- Downloading attachments (adapters/spaggiari/noticeboards.go:63)
- CLI commands for listing and downloading (entrypoints/cli/cmd/noticeboards/)
- Created SpaggiariClient with shared Get/Post methods and Unmarshal callback pattern
- Eliminated code duplication across agenda, grades, and noticeboards
- Updated mocks to use testify/mock v2.42.0 style
- Fixed mock initialization in tests
- Added proper mock expectations
Additional Notes
Reviewer checklist
main.README.md, if needed).CONTRIBUTING.md) and are well-formatted.