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).

@pasha-codefresh
Copy link

Lets use util world instead helpers, it will keep naming consistent with ArgoCD project


if instanceNameIncludesNs(instanceName) {
return parseInstanceName(instanceName)
} else {

Choose a reason for hiding this comment

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

this is redundant

namespace := parts[0]
app := parts[1]

return AppIdentity{

Choose a reason for hiding this comment

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

i would return references, it is easier to operate with them

@@ -0,0 +1,52 @@
package reporter

Choose a reason for hiding this comment

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

i would move it to some util folder

lastHistory := getLatestAppHistoryItem(a)

if lastHistory != nil {
id = lastHistory.ID

Choose a reason for hiding this comment

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

maybe better add return here, and not keep id as variable

lastHistory := getLatestAppHistoryItem(a)

if lastHistory != nil {
revision = lastHistory.Revision

Choose a reason for hiding this comment

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

same here, just return and if it is not exists return a.Status.Sync.Revision


func getOperationRevision(a *appv1.Application) string {
var revision string
if a != nil {

Choose a reason for hiding this comment

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

lets change to if a == nil { return "" } , and everything outside the block, such code will be easier to read

@oleksandr-codefresh oleksandr-codefresh changed the title refactor: reporter-code-splitting chore: reporter code splitting Jul 3, 2024
@oleksandr-codefresh oleksandr-codefresh force-pushed the reporter-code-splitting branch from e614d06 to 7647baa Compare July 3, 2024 14:20
@oleksandr-codefresh oleksandr-codefresh merged commit c0941bc into release-2.11 Jul 3, 2024
@ATGardner ATGardner deleted the reporter-code-splitting branch July 18, 2024 14:28
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