Skip to content

[V2] Add project service#7000

Merged
pingsutw merged 11 commits intoflyteorg:v2from
machichima:add-project-service
Mar 11, 2026
Merged

[V2] Add project service#7000
pingsutw merged 11 commits intoflyteorg:v2from
machichima:add-project-service

Conversation

@machichima
Copy link
Member

@machichima machichima commented Mar 10, 2026

Tracking issue

Why are the changes needed?

Add project service.

What changes were proposed in this pull request?

  • Add project service under runs/service/project_service.go and store project info to DB (project model: runs/repository/models/project.go)
  • Add string filter in runs/repository/impl/string_filters.go to deal with the filter with form value_in(state,0;1;2), which is used by ListProjects request
  • Add Domains into run service config, this will be inject into project service response
  • Add test scripts under runs/test/scripts/ for testing project service behavior

How was this patch tested?

  • unit test
  • Start local sandbox and run test scrips locally
# Create project
❯ PROJECT_ID=testproject-1773125257 bash runs/test/scripts/create_project.sh
{}

# Update project (state to archived)
❯ env PROJECT_ID=testproject-1773125257 STATE=PROJECT_STATE_ARCHIVED bash runs/test/scripts/update_project_status.sh
{}


# Get project
❯ PROJECT_ID=testproject-1773125257 runs/test/scripts/get_project.sh
{
  "project": {
    "id": "testproject-1773125257",
    "name": "Test Project",
    "domains": [
      {
        "id": "development",
        "name": "Development"
      },
      {
        "id": "production",
        "name": "Production"
      }
    ],
    "description": "Project created from script",
    "labels": {
      "values": {
        "team": "runs"
      }
    },
  }
}

# List project (with filter)
❯ FILTERS='value_in(state,0;1)' bash runs/test/scripts/list_projects.sh
{
  "projects": {
    "projects": [
      {
        "id": "testproject",
        "name": "Test Project",
        "domains": [
          {
            "id": "development",
            "name": "Development"
          },
          {
            "id": "production",
            "name": "Production"
          }
        ],
        "description": "Project created from script",
        "labels": {
          "values": {
            "team": "runs"
          }
        }
      },
      {
        "id": "testproject-1773125257",
        "name": "Test Project",
        "domains": [
          {
            "id": "development",
            "name": "Development"
          },
          {
            "id": "production",
            "name": "Production"
          }
        ],
        "description": "Project created from script",
        "labels": {
          "values": {
            "team": "runs"
          }
        },
        "state": "PROJECT_STATE_ARCHIVED"
      }
    ]
  }
}

Labels

Please add one or more of the following labels to categorize your PR:

  • added: For new features.
  • changed: For changes in existing functionality.
  • deprecated: For soon-to-be-removed features.
  • removed: For features being removed.
  • fixed: For any bug fixed.
  • security: In case of vulnerabilities

This is important to improve the readability of release notes.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
@machichima machichima marked this pull request as ready for review March 10, 2026 08:28
@github-actions github-actions bot mentioned this pull request Mar 10, 2026
3 tasks
@pingsutw
Copy link
Member

We should also have a default project, like

logger.Infof(ctx, "Seeding default projects...")
projects := []string{"flytesnacks"}
if len(cfg.SeedProjects) != 0 {
projects = cfg.SeedProjects
}

Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
Signed-off-by: machichima <nary12321@gmail.com>
@machichima
Copy link
Member Author

We should also have a default project

Done in 2027115

Signed-off-by: machichima <nary12321@gmail.com>
@pingsutw pingsutw merged commit 285e6c1 into flyteorg:v2 Mar 11, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants