Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CID-3105: React to manifest file creation via Webhook #32

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mohamedlajmileanix
Copy link
Contributor

🛠 Changes made

React to manifest file creation and update via Webhook, regardless of the location of the manifest file and supporting multiple manifest files within a single repository.

✨ Type of change

  • New feature (non-breaking change which adds functionality)

🧪 How Has This Been Tested?

  • should handle manifest file in subdirectory
  • should handle push event with multiple added and modified files

🏎 Checklist:

  • My code follows the style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (README.md)
  • My commit message clearly reflects the changes made
  • Assigned the appropriate labels (version, PR type, etc.)

@mohamedlajmileanix mohamedlajmileanix added the enhancement New feature or request label Oct 31, 2024
@mohamedlajmileanix mohamedlajmileanix requested a review from a team as a code owner October 31, 2024 10:39
Copy link

github-actions bot commented Oct 31, 2024

LeanIX GitHub Agent Code Coverage

File Coverage [90.87%] 🍏
Constants.kt 100% 🍏
GitHubScanningService.kt 94.14% 🍏
GitHubEnterpriseProperties.kt 92.31% 🍏
WebhookEventService.kt 86.94% 🍏
ManifestFileUpdateDto.kt 79.31% 🍏
Total Project Coverage 69.91% 🍏

Comment on lines 206 to 240
verify(exactly = 1) {
webSocketService.sendMessage(
"/events/manifestFile",
ManifestFileUpdateDto(
"owner/repo",
ManifestFileAction.ADDED,
"content",
"custom/path/added1/$MANIFEST_FILE_NAME"
)
)
}

verify(exactly = 1) {
webSocketService.sendMessage(
"/events/manifestFile",
ManifestFileUpdateDto(
"owner/repo",
ManifestFileAction.ADDED,
"content",
"custom/path/added2/$MANIFEST_FILE_NAME"
)
)
}

verify(exactly = 1) {
webSocketService.sendMessage(
"/events/manifestFile",
ManifestFileUpdateDto(
"owner/repo",
ManifestFileAction.MODIFIED,
"content",
"custom/path/modified/$MANIFEST_FILE_NAME"
)
)
}

Choose a reason for hiding this comment

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

I am not sure if the order is important here. but if it is, we should use verifyOrder

Copy link
Contributor

Choose a reason for hiding this comment

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

You can group all like this also:

 verify(exactly = 1) {
  webSocketService.sendMessage(1) 
  webSocketService.sendMessage(2)
  webSocketService.sendMessage(3)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ahmed-ali-55 thank you for the note but the order is not relevant here. I grouped them as @henriq-amaral-leanix suggested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

3 participants