drone/app/api/controller/aiagent/controller.go
Yogesh Chauhan 0af264d09f feat: [ML-338]: APIs for Harness Intelligence (#2667)
* Return empty summary/branch for now
* Fix Lint Issues
* feat: [ML-288]: API skeletons for Harness Intelligence
* fix ai pipelines (#2659)

* fix ai pipelines
* Update pipeline name (#2658)

* Update pipeline name
* fix: [ML-288]: update remediation prompt and suggestions (#2652)

* fix: [ML-288]: update remediation prompt and suggestions
* fix: [ML-288]: update url for artifact registry (#2651)

* fix: [ML-288]: update url for artifact registry
* Add snippet to mark code as written by Harness Intelligence (#2628)

* Add snippet to mark code as written by Harness Intelligence
* Add snippet to mark code as written by Harness Intelligence (#2626)

* Add snippet to mark code as written by Harness Intelligence
* feat: [ML-288]: link to harness artifact registry (#2619)

* some linting fixes
* feat: [ML-288]: link to harness artifact registry
* feat: [ML-286]: updating pipeline suggestions (#2620)

* updating suggestions
* feat: [ML-286]: updating pipeline suggestions
* feat: [ML-288]: adding slackbot (#2603)

* updating slack responses
* prevent responding to any bot messages
* feat: [ML-288]: adding slackbot
* throw error for commit
* commit stubbed
* feat: [ML-286]: moving stubbed response earlier in execution (#2602)

* feat: [ML-286]: moving stubbed response earlier in execution
* feat: [ML-286]: adding stubbed response for analyze execution (#2600)

* updating branch name
* adding updated-main for analyse-execution endpoint
* feat: [ML-286]: adding stubbed response for analyze execution
* Update AnalyseExecutionOutput to contain multi file diff (#2592)

* Create branch and commit changes on analyse
* Simplify AnalyseExecutionOutput to contain only high level summary and branch
* Update AnalyseExecutionOutput to contain multi file diff
* updating endpoints for unscripted demo (#2594)

* cleaning up code, adding suggested pipeline response
* updating suggestions api
* updating endpoints for unscripted demo
* Stub out generate pipeline yaml
2024-09-09 17:49:44 +00:00

58 lines
1.7 KiB
Go

// Copyright 2023 Harness, Inc.
//
// Licensed 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 aiagent
import (
"github.com/harness/gitness/app/auth/authz"
"github.com/harness/gitness/app/services/aiagent"
"github.com/harness/gitness/app/services/messaging"
"github.com/harness/gitness/app/store"
"github.com/harness/gitness/app/url"
"github.com/harness/gitness/git"
)
type Controller struct {
authorizer authz.Authorizer
pipeline *aiagent.HarnessIntelligence
repoStore store.RepoStore
pipelineStore store.PipelineStore
executionStore store.ExecutionStore
git git.Interface
urlProvider url.Provider
slackbot *messaging.Slack
}
func NewController(
authorizer authz.Authorizer,
pipeline *aiagent.HarnessIntelligence,
repoStore store.RepoStore,
pipelineStore store.PipelineStore,
executionStore store.ExecutionStore,
git git.Interface,
urlProvider url.Provider,
slackbot *messaging.Slack,
) *Controller {
return &Controller{
authorizer: authorizer,
pipeline: pipeline,
repoStore: repoStore,
pipelineStore: pipelineStore,
executionStore: executionStore,
git: git,
urlProvider: urlProvider,
slackbot: slackbot,
}
}