Skip to content

--bug=160690000 fix: support project and environment for services and templates#616

Merged
a-linye merged 1 commit into
TencentBlueKing:add-project-envfrom
Ambition9186:fix/project-env-support
Jul 15, 2026
Merged

--bug=160690000 fix: support project and environment for services and templates#616
a-linye merged 1 commit into
TencentBlueKing:add-project-envfrom
Ambition9186:fix/project-env-support

Conversation

@Ambition9186

Copy link
Copy Markdown
Collaborator

No description provided.

@Ambition9186 Ambition9186 changed the title fix: support project and environment for services and templates --bug =160690000 fix: support project and environment for services and templates Jul 15, 2026
@Ambition9186
Ambition9186 force-pushed the fix/project-env-support branch from f151518 to cbd08f4 Compare July 15, 2026 01:58

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1515182c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +2598 to +2599
bool all = 7
[(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { description: "是否获取所有", default: "false" }];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve tag 7 for env_id

This reuses field tag 7, which was uint32 env_id in the previous ListAppsRestReq, as bool all. Any gRPC client or persisted request built from the old proto that sends env_id will now be decoded as all=true, and environment filtering can no longer be represented on this message; protobuf tags should not be reused for different types or meanings. Keep/reserve env_id = 7 and assign all a new tag.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

都是新增的,不存在以上问题

}
}

apps, err := s.dao.App().ListAppsByIDs(kt, req.BizId, req.ProjectId, appIDs)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Forward project_id when listing app template sets

When the project/env HTTP route for ListAppTemplateSets goes through config-server, cmd/config-server/service/template_set.go still builds the data-service request with only BizId and AppId, so this new lookup receives req.ProjectId == 0. Because ListAppsByIDs filters by ProjID, it returns no apps and appEnvMap stays empty, causing the newly added TemplateSet.env_id to be 0 for all template sets returned through that config API path.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

已处理

@Ambition9186 Ambition9186 changed the title --bug =160690000 fix: support project and environment for services and templates --bug=160690000 fix: support project and environment for services and templates Jul 15, 2026
@Ambition9186 Ambition9186 reopened this Jul 15, 2026
@Ambition9186
Ambition9186 force-pushed the fix/project-env-support branch from cbd08f4 to 9951ae7 Compare July 15, 2026 02:49
for _, one := range s {
result = append(result, PbTemplateSet(one))
pb := PbTemplateSet(one)
// 一个模板绑定的所有 App 属于同一个环境,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

模版绑定的 app 应该可能是不同环境的?所有环境的app都能使用同一个模版

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

已处理

@Ambition9186
Ambition9186 force-pushed the fix/project-env-support branch from 9951ae7 to bec8966 Compare July 15, 2026 08:50
@Ambition9186
Ambition9186 force-pushed the fix/project-env-support branch from bec8966 to fcff30f Compare July 15, 2026 08:56
@a-linye
a-linye merged commit e5fb90d into TencentBlueKing:add-project-env Jul 15, 2026
7 checks passed
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.

2 participants