Enhancement: Add status field to projects table (default value: active)#5523
Enhancement: Add status field to projects table (default value: active)#5523
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a status column to the SQL-backed projects catalog so project records can carry a lifecycle/state indicator, and documents the change in the unreleased changelog.
Changes:
- Added
Statusfield toProjectGORM model with a DB default. - Fixed a typo in an existing struct field comment.
- Added an unreleased changelog entry for the new column.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/projects/manager/sql/sql.go | Extends the Project DB model with a Status column (and fixes a comment typo). |
| changelog/unreleased/project-status-field | Documents the schema enhancement for release notes. |
Comments suppressed due to low confidence (2)
pkg/projects/manager/sql/sql.go:76
- PR metadata says the new
statuscolumn should default to empty, but the model tag sets a DB default of'active'and the changelog also mentions'active'. Please align the implementation and documentation (either change the default in the GORM tag or update the PR title/changelog accordingly) to avoid an unintended schema default.
// Status of the project (e.g., active, pending creation, etc.)
Status string `gorm:"size:50;default:'active'"`
pkg/projects/manager/sql/sql.go:76
- The new
Statusfield introduces behavior (a DB-level default) but there’s no test asserting what value is persisted whenStatusis left unset/empty. Please add/extend an existing SQL manager test to create a project withoutStatusand verify the stored value matches the intended default.
Status string `gorm:"size:50;default:'active'"`
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b51f769 to
6fbe8b0
Compare
diocas
left a comment
There was a problem hiding this comment.
As Jesse pointed out, we will need to query the DB for all projects in "creating" status, so that we go throught them and check if we can finish, right? So, maybe an index should be added.
Don't we also need to add the filtering logic in Reva to use it later in cernboxcop?
That was going to be my next remark :) Additionally, do we want to filter on type "created" by default? Otherwise archived / pending_creation projects will also show up in your list of projects |
b284d7c to
defcddb
Compare
…nable the other two types if specified
f12e62d to
d08e213
Compare
d223510 to
d4fe4f4
Compare
… of going from archived to active
No description provided.