Skip to content

Conversation

@oleksandr-codefresh
Copy link

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Toolchain Guide
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

…EntityParentApp to pass data between methods
…Resource to pass data between methods, created new methods to group logic inside getResourceEventPayload
…onSyncRevisions, destServer, destName, appMultiSourced
…s SourcePositions, Revisions for GetManifests request
…sion for multi-sourced applications based on sync result revisions
…R-23668-multisource-details-reporting

# Conflicts:
#	event_reporter/reporter/application_event_reporter.go
#	event_reporter/reporter/event_payload.go
#	event_reporter/reporter/types.go
…ce index to which this resource belongs. Also updated logic of retrieving correct git commit info based on AppSourceIdx
}
if in.SourcePositions != nil && len(in.SourcePositions) > 0 {
for _, sourcePosition := range in.SourcePositions {
params = fmt.Sprintf("%s&sourcePositions=%s", params, sourcePosition)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you have linter issues here


// this value will be used in case if application hasn't resources , like gitsource
revisions := a.Status.Sync.Revisions
if a.Status.OperationState != nil && a.Status.OperationState.Operation.Sync != nil && a.Status.OperationState.Operation.Sync.Revisions != nil && len(a.Status.OperationState.Operation.Sync.Revisions) > 0 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets change to if -> return, and tbh i would move these if condition to some function, it is just very hard to read, i would move it to our custom types that we created before

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to separate func

}

func GetOperationStateRevision(a *appv1.Application) *string {
func GetOperationRevisions(a *appv1.Application) []string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also cover with basic test

return &a.Status.OperationState.SyncResult.Revision
}

func GetOperationSyncResultRevisions(a *appv1.Application) *[]string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some basic unit test


// findManifests looks at all yaml files in a directory and unmarshals them into a list of unstructured objects
func findManifests(logCtx *log.Entry, appPath string, repoRoot string, env *v1alpha1.Env, directory v1alpha1.ApplicationSourceDirectory, enabledManifestGeneration map[string]bool, maxCombinedManifestQuantity resource.Quantity) ([]manifest, error) {
absRepoRoot, err := filepath.Abs(repoRoot)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you changed it?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i just moved this line below, to have our changes in one place (will simplify new upstream version merging)

manifestInfo.Manifests[i].CompiledManifest = string(data)
}
}
manifests.SourcesManifestsStartingIdx = append(manifests.SourcesManifestsStartingIdx, int32(len(manifests.Manifests)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you need this field? should we push it to OSS ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need it to be able to report correct repo url, etc. for multi-sourced apps

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this info is useful for OSS also

@oleksandr-codefresh oleksandr-codefresh force-pushed the CR-23668-multisource-details-reporting branch from 39ee73d to b348e9a Compare November 13, 2024 11:21
@oleksandr-codefresh oleksandr-codefresh force-pushed the CR-23668-multisource-details-reporting branch from 69451f9 to d780165 Compare November 14, 2024 09:27
…R-23668-multisource-details-reporting

# Conflicts:
#	changelog/CHANGELOG.md
@oleksandr-codefresh oleksandr-codefresh merged commit a26fd08 into release-2.12 Dec 3, 2024
10 of 13 checks passed
@oleksandr-codefresh oleksandr-codefresh deleted the CR-23668-multisource-details-reporting branch December 3, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants