Skip to content

feat(organizations): display the organization slug in projects - #1287

Merged
annabelle-scalingo merged 8 commits into
masterfrom
STORY-4375/feat/projects-organization-column
Nov 20, 2026
Merged

annabelle-scalingo merged 8 commits into
masterfrom
STORY-4375/feat/projects-organization-column

Conversation

@annabelle-scalingo

@annabelle-scalingo annabelle-scalingo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

scalingo projects now shows the organization of each project (STORY-4375). Columns: NAME | ORGANIZATION | DEFAULT | ID

Screenshot 2026-11-10 at 17 31 30

ORGANIZATION contains the organization slug, empty for a personal project.
flow:

  • ProjectsList (personal projects)
  • OrganizationsList,
  • then one ProjectsListByOrganization call per organization

Checklist

  • Add a changelog entry in the section "To Be Released" of CHANGELOG.md

@notion-workspace

Copy link
Copy Markdown

@annabelle-scalingo annabelle-scalingo changed the title feat(projects): display the organization slug in projects feat(organizations): display the organization slug in projects Nov 10, 2026
@annabelle-scalingo

Copy link
Copy Markdown
Contributor Author

the tests are currently failing because the CLI depends on SDK changes that haven't been released yet

before publishing a new SDK version, I'd like to get your thoughts on the approach:

i initially chose to keep the existing projects#index behavior unchanged and fetch organization projects separately, using the organization IDs returned by the auth service
this means making multiple API requests, one per organization.

i'm wondering if this is the right approach, or if it would make more sense to expose an endpoint (or add a params to the existing one) to retrieve all the user's projects in a single request

WDYT @aurelien-reeves-scalingo ?

@aurelien-reeves-scalingo

Copy link
Copy Markdown
Contributor

I do not expect users to have a lot of organizations, so fetching projects with a few requests don't bother me.
However indeed, a dedicated endpoint may be interesting too, but I don't have a strong opinion.

@EtienneM would you have a preference?

@EtienneM

Copy link
Copy Markdown
Member

ORGANIZATION contains the organization slug, empty for a personal project.

Don't we want to write something to make it explicit that it's a personal project?

the tests are currently failing because the CLI depends on SDK changes that haven't been released yet

You can include these changes in the PR so that you can have the CI succeeded with:

go get github.com/Scalingo/go-scalingo/v11@<branch name>
go mod vendor
go mod tidy

this means making multiple API requests, one per organization.

We are used to make multiple API requests in the CLI to retrieve all the information we need. I like the idea of having API endpoint doing a single and simple job. Hence I would make multiple API requests. If we eventually have performance issues, we can reconsider this choice. But premature optimization is the root of all evil. And as pointed out by Aurélien, we don't expect users to have a lot of organizations. Hence we probably won't have that many requests.

annabelle-scalingo and others added 4 commits November 19, 2026 10:28
…label personal projects

Display `personal` in the ORGANIZATION column for personal projects and
drop the bounded concurrency: the SDK client is not documented as safe
for concurrent use, and one request per organization is enough here.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@annabelle-scalingo
annabelle-scalingo marked this pull request as ready for review November 19, 2026 16:12
@annabelle-scalingo
annabelle-scalingo requested a review from a team as a code owner November 19, 2026 16:12
@annabelle-scalingo
annabelle-scalingo requested review from EtienneM and removed request for a team November 19, 2026 16:12
@annabelle-scalingo

Copy link
Copy Markdown
Contributor Author

I gave a try to display personal in the org column, thinking it would make things clearer, but I'm not convinced

the column contains organization slugs, users might interpret personal as an actual slug and try to use it in other CLI commands, especially when changing a project's organization
also, we're not expecting to keep personal projects at long term, so I'd avoid introducing a special value

I think keeping the column empty for projects without an organization, as originally planned, would be less ambiguous
WDYT?

(thanks for the tips and for your inputs)

@EtienneM EtienneM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think keeping the column empty for projects without an organization, as originally planned, would be less ambiguous
WDYT?

Thanks for giving it a try. I didn't know that personal projects were only temporary. Let's keep it empty for now and we will see if it raises questions on our customers side :)

Comment thread projects/list_test.go Resolved
Comment thread projects/list.go Outdated
Comment on lines +17 to +20
type projectsLister interface {
ProjectsList(ctx context.Context) ([]scalingo.Project, error)
ProjectsListByOrganization(ctx context.Context, organizationID string) ([]scalingo.Project, error)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: we don't usually declare an interface here. We already have the interface ProjectsService in go-scalingo that should be mocked in the go-scalingo mocks.json.

Comment thread projects/list.go Outdated
projects, err := listWithOrganizations(ctx, c, c)
if err != nil {
return errors.Wrap(ctx, err, "list projects")
return err

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: all errors must be wrapped

Suggested change
return err
return errors.Wrap(ctx, err, "list projects with organizations")

Comment thread projects/list.go Outdated
}

projects, err := c.ProjectsList(ctx)
projects, err := listWithOrganizations(ctx, c, c)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion: I'm not convinced by these two c arguments here.

Comment thread projects/list.go Outdated

t := tablewriter.NewWriter(os.Stdout)
t.Header([]string{"Name", "Default", "ID"})
return render(os.Stdout, projects)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: all errors must be wrapped

Suggested change
return render(os.Stdout, projects)
listedProjects, err := render(os.Stdout, projects)
if err != nil {
nil, errors.Wrap(ctx, err, "render listed projects")
}
return listedProjects, nil

Comment thread projects/list.go Outdated
projects = append(projects, listedProject{project: project})
}

// The authentication service can return the same organization several times.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

question: isn't it odd that the backend service can return multiple times the same organizations? 😲
How is it possible that a listing endpoints have such a behaviour?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i initially added the deduplication as a safeguard because a user could potentially have multiple membership records for the same organization (being removed and added back)

but soft-deleted memberships are excluded and I agree this shouldn't be handled in the CLI,
I've removed the deduplication and its test

Comment thread projects/list.go Outdated

organizationProjects, err := projectsService.ProjectsListByOrganization(ctx, organization.ID)
if err != nil {
return nil, errors.Wrapf(ctx, err, "list projects of organization %s", organization.Slug)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

issue: we don't add slugs in error message

Suggested change
return nil, errors.Wrapf(ctx, err, "list projects of organization %s", organization.Slug)
return nil, errors.Wrap(ctx, err, "list organization projects")

…ication

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@annabelle-scalingo

Copy link
Copy Markdown
Contributor Author

thanks for the review @EtienneM (and sorry for the extra time it took you, i'm not familiar with Go and the repo conventions)!

i've fixed the error wrapping and deduplication comments

for the remaining comments about interfaces, mocks and the duplicated c argument, i had a look at the existing SDK:

from what I understand, I would need to update go-scalingo to:

  1. add ProjectsService to mocks.json and generate its mock
  2. add ProjectsService to scalingo.API to allow passing a single client instead of [c, c]

does that sound like the right approach to you, or do you have a simpler solution in mind?

@EtienneM

Copy link
Copy Markdown
Member

thanks for the review @EtienneM (and sorry for the extra time it took you, i'm not familiar with Go and the repo conventions)!

No problem, that's a pleasure to explain you these conventions. This highlights a lack of documentation, maybe in the go-scalingo README. I'll add that to my todo list.

for the remaining comments about interfaces, mocks and the duplicated c argument, i had a look at the existing SDK

I think that your solution matches what I had in mind. After doing this you'll unfortunately need to make a new go-scalingo release (patch version this time).

…he projects

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@EtienneM EtienneM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice 🙌

@annabelle-scalingo
annabelle-scalingo merged commit 9eb6c85 into master Nov 20, 2026
7 checks passed
@annabelle-scalingo
annabelle-scalingo deleted the STORY-4375/feat/projects-organization-column branch November 20, 2026 14:04
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.

3 participants