Skip to content

Commit

Permalink
chore: add asf headers
Browse files Browse the repository at this point in the history
  • Loading branch information
narrowizard committed May 31, 2024
1 parent 792805b commit cdbf90c
Show file tree
Hide file tree
Showing 17 changed files with 347 additions and 2 deletions.
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/api/init.go
Original file line number Diff line number Diff line change
@@ -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 api

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 e2e

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 e2e

import (
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/e2e/meta.go
Original file line number Diff line number Diff line change
@@ -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 e2e

import "github.com/apache/incubator-devlake/plugins/issue_trace/tasks"
Expand Down
24 changes: 22 additions & 2 deletions backend/plugins/issue_trace/impl/enricher.go
Original file line number Diff line number Diff line change
@@ -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 impl

import (
Expand All @@ -8,6 +25,7 @@ import (
"github.com/apache/incubator-devlake/core/plugin"
"github.com/apache/incubator-devlake/plugins/issue_trace/api"
"github.com/apache/incubator-devlake/plugins/issue_trace/models"
"github.com/apache/incubator-devlake/plugins/issue_trace/models/migrationscripts"
"github.com/apache/incubator-devlake/plugins/issue_trace/services"
"github.com/apache/incubator-devlake/plugins/issue_trace/tasks"
"github.com/mitchellh/mapstructure"
Expand Down Expand Up @@ -80,12 +98,14 @@ func (p IssueTrace) PrepareTaskData(taskCtx plugin.TaskContext, options map[stri
return taskData, nil
}

func (plugin IssueTrace) RootPkgPath() string {
func (p IssueTrace) RootPkgPath() string {
return "github.com/apache/incubator-devlake/plugins/issue_trace"
}

func (p IssueTrace) MigrationScripts() []plugin.MigrationScript {
return []plugin.MigrationScript{}
return []plugin.MigrationScript{
&migrationscripts.NewIssueTable{},
}
}

func (p IssueTrace) ApiResources() map[string]map[string]plugin.ApiResourceHandler {
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/issue_trace.go
Original file line number Diff line number Diff line change
@@ -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 main

import (
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/models/issue_assignee_history.go
Original file line number Diff line number Diff line change
@@ -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 models

import (
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/models/issue_status_history.go
Original file line number Diff line number Diff line change
@@ -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 models

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
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 (
"time"

"github.com/apache/incubator-devlake/core/context"
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/models/migrationscripts/archived"
"github.com/apache/incubator-devlake/helpers/migrationhelper"
)

type NewIssueTable struct {
}

func (*NewIssueTable) Up(basicRes context.BasicRes) errors.Error {
return migrationhelper.AutoMigrateTables(basicRes, &IssueStatusHistory20240530{}, &IssueAssigneeHistory20240530{})
}

func (*NewIssueTable) Version() uint64 {
return 20240530144400
}

func (*NewIssueTable) Name() string {
return "add issue_status_history and issue_assignee_history"
}

type IssueStatusHistory20240530 struct {
archived.NoPKModel
IssueId string `gorm:"primaryKey;type:varchar(255)"`
Status string `gorm:"type:varchar(100)"`
OriginalStatus string `gorm:"primaryKey;type:varchar(255)"`
StartDate time.Time `gorm:"primaryKey"`
EndDate *time.Time `gorm:"type:timestamp"`
IsCurrentStatus bool `gorm:"type:boolean"`
IsFirstStatus bool `gorm:"type:boolean"`
StatusTimeMinutes int32 `gorm:"type:integer"`
}

func (IssueStatusHistory20240530) TableName() string {
return "issue_status_history"
}

type IssueAssigneeHistory20240530 struct {
archived.NoPKModel
IssueId string `gorm:"primaryKey;type:varchar(255)"`
Assignee string `gorm:"primaryKey;type:varchar(255)"`
StartDate time.Time `gorm:"primaryKey"`
EndDate *time.Time
}

func (IssueAssigneeHistory20240530) TableName() string {
return "issue_assignee_history"
}
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/services/query.go
Original file line number Diff line number Diff line change
@@ -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 services

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 tasks

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 tasks

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -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 tasks

import (
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/tasks/task_data.go
Original file line number Diff line number Diff line change
@@ -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 tasks

// Options original parameter from bp (or pipeline)
Expand Down
17 changes: 17 additions & 0 deletions backend/plugins/issue_trace/utils/array.go
Original file line number Diff line number Diff line change
@@ -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 utils

import "strings"
Expand Down
Loading

0 comments on commit cdbf90c

Please sign in to comment.