kostas-petrakis opened a new issue, #8237:
URL: https://github.com/apache/incubator-devlake/issues/8237
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
## Question: ScopeId as varchar in BlueprintScope causing Jira plugin issues
I'm working on fixing some PostgreSQL-related issues and noticed that the
`ScopeId` field in the `BlueprintScope` struct is defined as a `string`:
```go
type BlueprintScope struct {
BlueprintId uint64 `json:"-" gorm:"primaryKey" validate:"required"`
PluginName string `json:"-" gorm:"primaryKey;type:varchar(255)"
validate:"required"`
ConnectionId uint64 `json:"-" gorm:"primaryKey" validate:"required"`
ScopeId string `json:"scopeId" gorm:"primaryKey;type:varchar(255)"
validate:"required"`
}
```
This is causing errors when configuring the Jira plugin, specifically when
`ScopeId` (which is a string) is compared with `board_id` (which seems to be a
`bigint` in the Jira plugin's table):
```shell
ERROR: operator does not exist: bigint = character varying (SQLSTATE
42883)\n\x1b[0m\x1b[33m[1.048ms] \x1b[34;1m[rows:0]\x1b[0m SELECT bp.id AS
blueprint_id, bp.project_name, bps.scope_id, _tool_jira_boards.* FROM
_devlake_blueprint_scopes bps LEFT JOIN _devlake_blueprints bp ON (bp.id =
bps.blueprint_id) LEFT JOIN _tool_jira_boards ON
(_tool_jira_boards.connection_id = bps.connection_id AND
_tool_jira_boards.board_id = bps.scope_id) WHERE bps.plugin_name = 'jira' AND
bps.connection_id = 2"
2024/12/10 15:42:34 [Recovery] 2024/12/10 - 15:42:34 panic recovered:
ERROR: operator does not exist: bigint = character varying (SQLSTATE 42883)
(500)
Wraps: (2) ERROR: operator does not exist: bigint = character varying
(SQLSTATE 42883)
```
I'm currently working on a workaround that involves checking the database
dialect, but a cleaner solution might be to change `ScopeId` to `uint64`.
Before I pursue that route, I wanted to check if there's a specific reason
why `ScopeId` is defined as `string`. Is there a plugin or use case that relies
on `ScopeId` being a string? Otherwise we could possibly convert this field
type?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]