Skip to content

Commit

Permalink
Merge pull request #2039 from opengovern/feat-change-jobs
Browse files Browse the repository at this point in the history
Feat change jobs
  • Loading branch information
mohamadch91 authored Nov 18, 2024
2 parents 50a734d + a9ba6d1 commit e6d2cbe
Show file tree
Hide file tree
Showing 112 changed files with 125 additions and 126 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ jobs:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/checkup-job:${{ needs.tag.outputs.latest_tag }}
file: docker/CheckupJobDockerfile
file: docker/checkupJobDockerfile
context: .

deploy-compliance-report-job:
Expand Down
2 changes: 1 addition & 1 deletion cmd/checkup-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

"github.com/opengovern/opengovernance/jobs/checkup"
"github.com/opengovern/opengovernance/jobs/checkup-job"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compliance-report-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

runner "github.com/opengovern/opengovernance/jobs/compliance-runner"
runner "github.com/opengovern/opengovernance/jobs/compliance-runner-job"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/compliance-summarizer-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

summarizer "github.com/opengovern/opengovernance/jobs/compliance-summarizer"
summarizer "github.com/opengovern/opengovernance/jobs/compliance-summarizer-job"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/demo-importer-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

demoimporter "github.com/opengovern/opengovernance/jobs/demo-importer"
demoimporter "github.com/opengovern/opengovernance/jobs/demo-importer-job"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/query-runner-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

queryrunner "github.com/opengovern/opengovernance/jobs/query-runner"
queryrunner "github.com/opengovern/opengovernance/jobs/query-runner-job"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion cmd/query-validator-job/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os/signal"
"syscall"

queryvalidator "github.com/opengovern/opengovernance/jobs/query-validator"
queryvalidator "github.com/opengovern/opengovernance/jobs/query-validator-job"
)

func main() {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion jobs/checkup/command.go → jobs/checkup-job/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"

config2 "github.com/opengovern/og-util/pkg/config"
"github.com/opengovern/opengovernance/jobs/checkup/config"
"github.com/opengovern/opengovernance/jobs/checkup-job/config"

"github.com/spf13/cobra"
"go.uber.org/zap"
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions jobs/checkup/job.go → jobs/checkup-job/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import (
authAPI "github.com/opengovern/og-util/pkg/api"
shared_entities "github.com/opengovern/og-util/pkg/api/shared-entities"
"github.com/opengovern/og-util/pkg/httpclient"
"github.com/opengovern/opengovernance/jobs/checkup/config"
"github.com/opengovern/opengovernance/jobs/checkup-job/config"
authClient "github.com/opengovern/opengovernance/services/auth/client"
metadataClient "github.com/opengovern/opengovernance/services/metadata/client"
"golang.org/x/net/context"

"github.com/go-errors/errors"
"github.com/opengovern/opengovernance/jobs/checkup/api"
"github.com/opengovern/opengovernance/jobs/checkup-job/api"
"github.com/opengovern/opengovernance/services/integration/client"
"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion jobs/checkup/worker.go → jobs/checkup-job/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"

"github.com/opengovern/og-util/pkg/jq"
"github.com/opengovern/opengovernance/jobs/checkup/config"
"github.com/opengovern/opengovernance/jobs/checkup-job/config"
authClient "github.com/opengovern/opengovernance/services/auth/client"
metadataClient "github.com/opengovern/opengovernance/services/metadata/client"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
es2 "github.com/opengovern/og-util/pkg/es"
"github.com/opengovern/og-util/pkg/httpclient"
"github.com/opengovern/og-util/pkg/opengovernance-es-sdk"
types2 "github.com/opengovern/opengovernance/jobs/compliance-summarizer/types"
types2 "github.com/opengovern/opengovernance/jobs/compliance-summarizer-job/types"
"github.com/opengovern/opengovernance/pkg/types"
"github.com/opengovern/opengovernance/services/compliance/es"
es3 "github.com/opengovern/opengovernance/services/describe/es"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package summarizer
import (
"time"

"github.com/opengovern/opengovernance/jobs/compliance-summarizer/types"
"github.com/opengovern/opengovernance/jobs/compliance-summarizer-job/types"
)

type ComplianceSummarizerStatus string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
esSinkClient "github.com/opengovern/og-util/pkg/es/ingest/client"
"github.com/opengovern/og-util/pkg/jq"
"github.com/opengovern/og-util/pkg/opengovernance-es-sdk"
"github.com/opengovern/opengovernance/jobs/compliance-summarizer/types"
"github.com/opengovern/opengovernance/jobs/compliance-summarizer-job/types"
integrationClient "github.com/opengovern/opengovernance/services/integration/client"
inventoryClient "github.com/opengovern/opengovernance/services/inventory/client"
"go.uber.org/zap"
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions jobs/demo-importer/cmd.go → jobs/demo-importer-job/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"github.com/opengovern/og-util/pkg/config"
"github.com/opengovern/og-util/pkg/httpclient"
"github.com/opengovern/og-util/pkg/postgres"
db2 "github.com/opengovern/opengovernance/jobs/demo-importer/db"
"github.com/opengovern/opengovernance/jobs/demo-importer/fetch"
"github.com/opengovern/opengovernance/jobs/demo-importer/types"
"github.com/opengovern/opengovernance/jobs/demo-importer/worker"
db2 "github.com/opengovern/opengovernance/jobs/demo-importer-job/db"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/fetch"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/types"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/worker"
"github.com/opengovern/opengovernance/services/metadata/client"
"github.com/opengovern/opengovernance/services/metadata/models"
"github.com/opensearch-project/opensearch-go/v4"
Expand Down
2 changes: 1 addition & 1 deletion jobs/migrator/db/db.go → jobs/demo-importer-job/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"

"github.com/jackc/pgtype"
"github.com/opengovern/opengovernance/jobs/migrator/db/model"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/db/model"
"gorm.io/gorm"
)

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/transport"
githttp "github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/opengovern/opengovernance/jobs/demo-importer/types"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/types"
"go.uber.org/zap"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"time"

"github.com/jackc/pgtype"
"github.com/opengovern/opengovernance/jobs/demo-importer/db"
"github.com/opengovern/opengovernance/jobs/demo-importer/db/model"
"github.com/opengovern/opengovernance/jobs/demo-importer/types"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/db"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/db/model"
"github.com/opengovern/opengovernance/jobs/demo-importer-job/types"
"github.com/opensearch-project/opensearch-go/v4/opensearchapi"
"go.uber.org/zap"
)
Expand Down
30 changes: 0 additions & 30 deletions jobs/migrator/job/migration_list.go

This file was deleted.

4 changes: 2 additions & 2 deletions jobs/migrator/cmd.go → jobs/post-install-job/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"

"github.com/opengovern/og-util/pkg/config"
config2 "github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/job"
config2 "github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/job"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"

"github.com/jackc/pgtype"
"github.com/opengovern/opengovernance/jobs/demo-importer/db/model"
"github.com/opengovern/opengovernance/jobs/post-install-job/db/model"
"gorm.io/gorm"
)

Expand Down
File renamed without changes.
7 changes: 3 additions & 4 deletions jobs/migrator/job/git.go → jobs/post-install-job/job/git.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package job

import (

"os"

"encoding/json"
"encoding/json"
// "strings"
git2 "github.com/opengovern/opengovernance/jobs/migrator/job/git"
"github.com/opengovern/og-util/pkg/api"
"github.com/opengovern/og-util/pkg/httpclient"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
git2 "github.com/opengovern/opengovernance/jobs/post-install-job/job/git"
"github.com/opengovern/opengovernance/services/metadata/client"
"github.com/opengovern/opengovernance/services/metadata/models"
"go.uber.org/zap"
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions jobs/post-install-job/job/migration_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package job

import (
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/auth"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/compliance"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/elasticsearch"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/integration"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/inventory"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/metadata"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/resource_collection"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/resource_info"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/types"
)

var migrations = map[string]types.Migration{

"elasticsearch": elasticsearch.Migration{},

}

var manualMigrations =map[string]types.Migration{
"metadata": metadata.Migration{},
"integration": integration.Migration{},
"inventory": inventory.Migration{},
"resource_collection": resource_collection.Migration{},
"elasticsearch": elasticsearch.Migration{},
"compliance": compliance.Migration{},
"resource_info": resource_info.Migration{},
"auth": auth.Migration{},
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
dexApi "github.com/dexidp/dex/api/v2"
"github.com/opengovern/og-util/pkg/api"
"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/services/auth/db"
"go.uber.org/zap"
"golang.org/x/crypto/bcrypt"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/goccy/go-yaml"
"github.com/jackc/pgtype"
"github.com/opengovern/og-util/pkg/model"
"github.com/opengovern/opengovernance/jobs/migrator/job/git"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/git"
"github.com/opengovern/opengovernance/pkg/types"
"github.com/opengovern/opengovernance/services/compliance/db"
"github.com/opengovern/opengovernance/services/metadata/models"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"

"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/services/compliance/db"
"github.com/opengovern/opengovernance/services/metadata/models"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package compliance

import (
"github.com/opengovern/opengovernance/jobs/migrator/job/migrations/shared"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/migrations/shared"
)

type Benchmark struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/opengovern/og-util/pkg/opengovernance-es-sdk"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"

"github.com/jackc/pgtype"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/db"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/db"
integration_type "github.com/opengovern/opengovernance/services/integration/integration-type"
integrationModels "github.com/opengovern/opengovernance/services/integration/models"
"gorm.io/gorm/clause"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/opengovern/og-util/pkg/model"
"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/db"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/db"
integration_type "github.com/opengovern/opengovernance/services/integration/integration-type"
"github.com/opengovern/opengovernance/services/inventory"
"go.uber.org/zap"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"

"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/db"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/db"
"github.com/opengovern/opengovernance/services/metadata/models"
"go.uber.org/zap"
"gorm.io/gorm/clause"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/opengovern/og-util/pkg/model"
"github.com/opengovern/og-util/pkg/opengovernance-es-sdk"
"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/db"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/db"
"github.com/opengovern/opengovernance/services/inventory"
"go.uber.org/zap"
"gorm.io/gorm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"path"

"github.com/opengovern/og-util/pkg/postgres"
"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/migrator/db"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/db"
integration_type "github.com/opengovern/opengovernance/services/integration/integration-type"
"github.com/opengovern/opengovernance/services/inventory"
"go.uber.org/zap"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package types
import (
"context"

"github.com/opengovern/opengovernance/jobs/migrator/config"
"github.com/opengovern/opengovernance/jobs/post-install-job/config"
"go.uber.org/zap"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"
"time"

"github.com/opengovern/opengovernance/jobs/migrator/db/model"
"github.com/opengovern/opengovernance/jobs/migrator/job/types"
"github.com/opengovern/opengovernance/jobs/post-install-job/db/model"
"github.com/opengovern/opengovernance/jobs/post-install-job/job/types"
"go.uber.org/zap"
)

Expand Down
Loading

0 comments on commit e6d2cbe

Please sign in to comment.