Skip to content

Enhancement: Add status field to projects table (default value: active)#5523

Merged
diocas merged 8 commits intomasterfrom
update_projects_table
Mar 4, 2026
Merged

Enhancement: Add status field to projects table (default value: active)#5523
diocas merged 8 commits intomasterfrom
update_projects_table

Conversation

@pmedinar01
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 2, 2026 10:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Status field to Project GORM 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 status column 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 Status field introduces behavior (a DB-level default) but there’s no test asserting what value is persisted when Status is left unset/empty. Please add/extend an existing SQL manager test to create a project without Status and 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.

@pmedinar01 pmedinar01 force-pushed the update_projects_table branch from b51f769 to 6fbe8b0 Compare March 2, 2026 10:21
Comment thread pkg/projects/manager/sql/sql.go Outdated
Copy link
Copy Markdown
Contributor

@diocas diocas left a comment

Choose a reason for hiding this comment

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

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?

@jessegeens
Copy link
Copy Markdown
Contributor

jessegeens commented Mar 2, 2026

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

@pmedinar01 pmedinar01 force-pushed the update_projects_table branch from b284d7c to defcddb Compare March 2, 2026 12:47
@pmedinar01 pmedinar01 force-pushed the update_projects_table branch from f12e62d to d08e213 Compare March 2, 2026 13:36
@pmedinar01 pmedinar01 changed the title Enhancement: Add status field to projects table (default value: empty) Enhancement: Add status field to projects table (default value: active) Mar 2, 2026
Comment thread pkg/projects/manager/sql/sql.go Outdated
Comment thread pkg/projects/manager/sql/sql.go Outdated
Comment thread pkg/projects/manager/sql/sql.go Outdated
Comment thread pkg/projects/manager/sql/sql.go Outdated
@pmedinar01 pmedinar01 force-pushed the update_projects_table branch from d223510 to d4fe4f4 Compare March 3, 2026 12:22
@pmedinar01 pmedinar01 requested a review from jessegeens March 3, 2026 12:27
@pmedinar01 pmedinar01 requested a review from diocas March 3, 2026 14:09
Comment thread pkg/projects/manager/memory/memory.go
Comment thread pkg/projects/manager/sql/sql.go Outdated
Comment thread pkg/projects/manager/sql/sql.go
Comment thread pkg/projects/manager/sql/sql.go Outdated
Copy link
Copy Markdown
Contributor

@jessegeens jessegeens left a comment

Choose a reason for hiding this comment

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

@pmedinar01 pmedinar01 requested a review from jessegeens March 3, 2026 15:42
jessegeens
jessegeens previously approved these changes Mar 3, 2026
@diocas diocas merged commit b7e2f46 into master Mar 4, 2026
24 checks passed
@diocas diocas deleted the update_projects_table branch March 4, 2026 08:06
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.

5 participants