Skip to content

Commit

Permalink
Update github_repository_vulnerability_alert and github_repository_de…
Browse files Browse the repository at this point in the history
…ployment table (#365)
  • Loading branch information
bigdatasourav authored Dec 1, 2023
1 parent 4e3a0ff commit 55a2bb6
Show file tree
Hide file tree
Showing 7 changed files with 479 additions and 80 deletions.
34 changes: 18 additions & 16 deletions github/models/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,28 @@ package models
import "github.com/shurcooL/githubv4"

type Environment struct {
basicIdentifiers
Id int `graphql:"id: databaseId @include(if:$includeEnvironmentId)" json:"id,omitempty"`
NodeId string `graphql:"nodeId: id @include(if:$includeEnvironmentNodeId)" json:"node_id,omitempty"`
Name string `graphql:"name @include(if:$includeEnvironmentName)" json:"name,omitempty"`
// protectionRules [pageable]
}

type Deployment struct {
Id int `graphql:"id: databaseId" json:"id,omitempty"`
NodeId string `graphql:"nodeId: id" json:"node_id,omitempty"`
CommitSha string `graphql:"sha: commitOid" json:"sha"`
CreatedAt NullableTime `json:"created_at"`
Creator Actor `json:"creator"`
Description string `json:"description"`
Environment string `json:"environment"`
LatestEnvironment string `json:"latest_environment"`
LatestStatus DeploymentStatus `json:"latest_status"`
OriginalEnvironment string `json:"original_environment"`
Payload string `json:"payload"`
Ref BasicRef `json:"ref"`
State githubv4.DeploymentState `json:"state"`
Task string `json:"task"`
UpdatedAt NullableTime `json:"updated_at"`
Id int `graphql:"id: databaseId @include(if:$includeDeploymentId)" json:"id,omitempty"`
NodeId string `graphql:"nodeId: id @include(if:$includeDeploymentNodeId)" json:"node_id,omitempty"`
CommitSha string `graphql:"sha: commitOid @include(if:$includeDeploymentCommitSha)" json:"sha"`
CreatedAt NullableTime `graphql:"createdAt @include(if:$includeDeploymentCreatedAt)" json:"created_at,omitempty"`
Creator Actor `graphql:"creator @include(if:$includeDeploymentCreator)" json:"creator,omitempty"`
Description string `graphql:"description @include(if:$includeDeploymentDescription)" json:"description,omitempty"`
Environment string `graphql:"environment @include(if:$includeDeploymentEnvironment)" json:"environment,omitempty"`
LatestEnvironment string `graphql:"latestEnvironment @include(if:$includeDeploymentLatestEnvironment)" json:"latest_environment,omitempty"`
LatestStatus DeploymentStatus `graphql:"latestStatus @include(if:$includeDeploymentLatestStatus)" json:"latest_status,omitempty"`
OriginalEnvironment string `graphql:"originalEnvironment @include(if:$includeDeploymentOriginalEnvironment)" json:"original_environment,omitempty"`
Payload string `graphql:"payload @include(if:$includeDeploymentPayload)" json:"payload,omitempty"`
Ref BasicRef `graphql:"ref @include(if:$includeDeploymentRef)" json:"ref,omitempty"`
State githubv4.DeploymentState `graphql:"state @include(if:$includeDeploymentState)" json:"state,omitempty"`
Task string `graphql:"task @include(if:$includeDeploymentTask)" json:"task,omitempty"`
UpdatedAt NullableTime `graphql:"updatedAt @include(if:$includeDeploymentUpdatedAt)" json:"updated_at,omitempty"`
}

type DeploymentStatus struct {
Expand Down
32 changes: 16 additions & 16 deletions github/models/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ package models
import "github.com/shurcooL/githubv4"

type RepositoryVulnerabilityAlert struct {
NodeId string `graphql:"nodeId: id" json:"node_id"`
Number int `json:"number"`
AutoDismissedAt NullableTime `json:"auto_dismissed_at"`
CreatedAt NullableTime `json:"created_at"`
DependencyScope githubv4.RepositoryVulnerabilityAlertDependencyScope `json:"dependency_scope"`
DismissComment string `json:"dismiss_comment"`
DismissReason string `json:"dismiss_reason"`
DismissedAt NullableTime `json:"dismissed_at"`
Dismisser BasicUser `json:"dismisser"`
FixedAt NullableTime `json:"fixed_at"`
State githubv4.RepositoryVulnerabilityAlertState `json:"state"`
SecurityAdvisory SecurityAdvisory `json:"security_advisory"`
SecurityVulnerability SecurityVulnerability `json:"security_vulnerability"`
VulnerableManifestFilename string `json:"vulnerable_manifest_filename"`
VulnerableManifestPath string `json:"vulnerable_manifest_path"`
VulnerableRequirements string `json:"vulnerable_requirements"`
NodeId string `graphql:"nodeId: id @include(if:$includeVulnerabilityAlertNodeId)" json:"node_id"`
Number int `graphql:"number: number @include(if:$includeVulnerabilityAlertNumber)" json:"number"`
AutoDismissedAt NullableTime `graphql:"autoDismissedAt: autoDismissedAt @include(if:$includeVulnerabilityAlertAutoDismissedAt)" json:"auto_dismissed_at"`
CreatedAt NullableTime `graphql:"createdAt: createdAt @include(if:$includeVulnerabilityAlertCreatedAt)" json:"created_at"`
DependencyScope githubv4.RepositoryVulnerabilityAlertDependencyScope `graphql:"dependencyScope: dependencyScope @include(if:$includeVulnerabilityAlertDependencyScope)" json:"dependency_scope"`
DismissComment string `graphql:"dismissComment: dismissComment @include(if:$includeVulnerabilityAlertDismissComment)" json:"dismiss_comment"`
DismissReason string `graphql:"dismissReason: dismissReason @include(if:$includeVulnerabilityAlertDismissReason)" json:"dismiss_reason"`
DismissedAt NullableTime `graphql:"dismissedAt: dismissedAt @include(if:$includeVulnerabilityAlertDismissedAt)" json:"dismissed_at"`
Dismisser BasicUser `graphql:"dismisser: dismisser @include(if:$includeVulnerabilityAlertDismisser)" json:"dismisser"`
FixedAt NullableTime `graphql:"fixedAt: fixedAt @include(if:$includeVulnerabilityAlertFixedAt)" json:"fixed_at"`
State githubv4.RepositoryVulnerabilityAlertState `graphql:"state: state @include(if:$includeVulnerabilityAlertState)" json:"state"`
SecurityAdvisory SecurityAdvisory `graphql:"securityAdvisory: securityAdvisory @include(if:$includeVulnerabilityAlertSecurityAdvisory)" json:"security_advisory"`
SecurityVulnerability SecurityVulnerability `graphql:"securityVulnerability: securityVulnerability @include(if:$includeVulnerabilityAlertSecurityVulnerability)" json:"security_vulnerability"`
VulnerableManifestFilename string `graphql:"vulnerableManifestFilename: vulnerableManifestFilename @include(if:$includeVulnerabilityAlertVulnerableManifestFilename)" json:"vulnerable_manifest_filename"`
VulnerableManifestPath string `graphql:"vulnerableManifestPath: vulnerableManifestPath @include(if:$includeVulnerabilityAlertVulnerableManifestPath)" json:"vulnerable_manifest_path"`
VulnerableRequirements string `graphql:"vulnerableRequirements: vulnerableRequirements @include(if:$includeVulnerabilityAlertVulnerableRequirements)" json:"vulnerable_requirements"`
}

type SecurityAdvisory struct {
Expand Down
Loading

0 comments on commit 55a2bb6

Please sign in to comment.