From 8749a36a20bad5c0db4b64c3007f893900a4991e Mon Sep 17 00:00:00 2001 From: bujjibabukatta Date: Tue, 2 Jun 2026 23:05:04 +0530 Subject: [PATCH 1/3] fix(jenkins): expand primary_view column to text --- backend/plugins/jenkins/models/job.go | 2 +- .../20260602_expand_primary_view.go | 29 +++++++++++++++++++ .../models/migrationscripts/register.go | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go diff --git a/backend/plugins/jenkins/models/job.go b/backend/plugins/jenkins/models/job.go index e4b5b84a645..8a5a6918f77 100644 --- a/backend/plugins/jenkins/models/job.go +++ b/backend/plugins/jenkins/models/job.go @@ -35,7 +35,7 @@ type JenkinsJob struct { Base string `gorm:"type:varchar(255)" mapstructure:"base,omitempty" json:"base"` Url string `mapstructure:"url,omitempty" json:"url"` Description string `mapstructure:"description,omitempty" json:"description"` - PrimaryView string `gorm:"type:varchar(255)" mapstructure:"primaryView,omitempty" json:"primaryView"` + PrimaryView string `gorm:"type:text" mapstructure:"primaryView,omitempty" json:"primaryView"` } func (JenkinsJob) TableName() string { diff --git a/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go new file mode 100644 index 00000000000..7644edd717e --- /dev/null +++ b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go @@ -0,0 +1,29 @@ +package migrationscripts + +import ( + "github.com/apache/incubator-devlake/core/context" + "github.com/apache/incubator-devlake/core/errors" + "github.com/apache/incubator-devlake/helpers/migrationhelper" +) + +type expandPrimaryView struct{} + +type JenkinsJob20260602 struct { + PrimaryView string `gorm:"type:text"` +} + +func (JenkinsJob20260602) TableName() string { + return "_tool_jenkins_jobs" +} + +func (u *expandPrimaryView) Up(baseRes context.BasicRes) errors.Error { + return migrationhelper.AutoMigrateTables(baseRes, &JenkinsJob20260602{}) +} + +func (*expandPrimaryView) Version() uint64 { + return 20260602000000 +} + +func (*expandPrimaryView) Name() string { + return "expand primary_view column to text" +} \ No newline at end of file diff --git a/backend/plugins/jenkins/models/migrationscripts/register.go b/backend/plugins/jenkins/models/migrationscripts/register.go index 1dc1eb84b15..50322d0b8d1 100644 --- a/backend/plugins/jenkins/models/migrationscripts/register.go +++ b/backend/plugins/jenkins/models/migrationscripts/register.go @@ -36,5 +36,6 @@ func All() []plugin.MigrationScript { new(renameTr2ScopeConfig), new(addRawParamTableForScope), new(addNumberToJenkinsBuildCommit), + new(expandPrimaryView), } } From ea34f30c97d9868003d2891d18a38c172f0e8a40 Mon Sep 17 00:00:00 2001 From: bujjibabukatta Date: Wed, 3 Jun 2026 20:52:58 +0530 Subject: [PATCH 2/3] fix(jenkins): address golangci-lint issues in primary_view migration --- .../20260602_expand_primary_view.go | 17 +++++++++++++++++ .../register/jira/connection-fields/auth.tsx | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go index 7644edd717e..aa519880fdd 100644 --- a/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go +++ b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go @@ -1,3 +1,20 @@ +/* +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. +*/ + package migrationscripts import ( diff --git a/config-ui/src/plugins/register/jira/connection-fields/auth.tsx b/config-ui/src/plugins/register/jira/connection-fields/auth.tsx index a85999ba3b0..24ead2db762 100644 --- a/config-ui/src/plugins/register/jira/connection-fields/auth.tsx +++ b/config-ui/src/plugins/register/jira/connection-fields/auth.tsx @@ -124,7 +124,7 @@ export const Auth = ({ type, initialValues, values, setValues, setErrors }: Prop Jira Cloud - Jira Server + Jira Data Center } From 909ab14c775b722c8242209da5d9f97e482818ce Mon Sep 17 00:00:00 2001 From: bujjibabukatta Date: Wed, 3 Jun 2026 21:22:21 +0530 Subject: [PATCH 3/3] remove unintended file --- .../register/jira/connection-fields/auth.tsx | 231 ------------------ 1 file changed, 231 deletions(-) delete mode 100644 config-ui/src/plugins/register/jira/connection-fields/auth.tsx diff --git a/config-ui/src/plugins/register/jira/connection-fields/auth.tsx b/config-ui/src/plugins/register/jira/connection-fields/auth.tsx deleted file mode 100644 index 24ead2db762..00000000000 --- a/config-ui/src/plugins/register/jira/connection-fields/auth.tsx +++ /dev/null @@ -1,231 +0,0 @@ -/* - * 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. - * - */ - -import { useState, useEffect } from 'react'; -import type { RadioChangeEvent } from 'antd'; -import { Radio, Input } from 'antd'; - -import { Block, ExternalLink } from '@/components'; -import { DOC_URL } from '@/release'; - -const JIRA_CLOUD_REGEX = /^https:\/\/\w+.atlassian.net\/rest\/$/; - -type Method = 'BasicAuth' | 'AccessToken'; - -interface Props { - type: 'create' | 'update'; - initialValues: any; - values: any; - errors: any; - setValues: (value: any) => void; - setErrors: (value: any) => void; -} - -export const Auth = ({ type, initialValues, values, setValues, setErrors }: Props) => { - const [version, setVersion] = useState('cloud'); - - useEffect(() => { - if (initialValues.endpoint && !JIRA_CLOUD_REGEX.test(initialValues.endpoint)) { - setVersion('server'); - } - }, [initialValues.endpoint]); - - useEffect(() => { - setValues({ - endpoint: initialValues.endpoint, - authMethod: initialValues.authMethod ?? 'BasicAuth', - username: initialValues.username, - password: initialValues.password, - token: initialValues.token, - }); - }, [ - initialValues.endpoint, - initialValues.authMethod, - initialValues.username, - initialValues.password, - initialValues.token, - ]); - - useEffect(() => { - const required = - (values.authMethod === 'BasicAuth' && values.username && values.password) || - (values.authMethod === 'AccessToken' && values.token) || - type === 'update'; - setErrors({ - endpoint: !values.endpoint ? 'endpoint is required' : '', - auth: required ? '' : 'auth is required', - }); - }, [values]); - - const handleChangeVersion = (e: RadioChangeEvent) => { - const version = e.target.value; - - setValues({ - endpoint: '', - authMethod: 'BasicAuth', - username: undefined, - password: undefined, - token: undefined, - }); - - setVersion(version); - }; - - const handleChangeEndpoint = (e: React.ChangeEvent) => { - setValues({ - endpoint: e.target.value, - }); - }; - - const handleChangeMethod = (e: RadioChangeEvent) => { - setValues({ - authMethod: (e.target as HTMLInputElement).value as Method, - username: undefined, - password: undefined, - token: undefined, - }); - }; - - const handleChangeUsername = (e: React.ChangeEvent) => { - setValues({ - username: e.target.value, - }); - }; - - const handleChangePassword = (e: React.ChangeEvent) => { - setValues({ - password: e.target.value, - }); - }; - - const handleChangeToken = (e: React.ChangeEvent) => { - setValues({ - token: e.target.value, - }); - }; - - return ( - <> - - - Jira Cloud - Jira Data Center - - - - {version === 'cloud' - ? 'Provide the Jira instance API endpoint. For Jira Cloud, e.g. https://your-company.atlassian.net/rest/. Please note that the endpoint URL should end with /.' - : ''} - {version === 'server' - ? 'Provide the Jira instance API endpoint. For Jira Data Center, e.g. https://jira.your-company.com/rest/. Please note that the endpoint URL should end with /.' - : ''} - - } - required - > - - - - - {version === 'cloud' && ( - <> - - - - Learn about how to create an API Token - } - required - > - - - - )} - - {version === 'server' && ( - <> - - - Basic Authentication - Using Personal Access Token - - - {values.authMethod === 'BasicAuth' && ( - <> - - - - - - - - )} - {values.authMethod === 'AccessToken' && ( - - Learn about how to create a PAT - - } - required - > - - - )} - - )} - - ); -};