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

feat: Send codemagic build errors to slack, bump app version #16309

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

eirikurn
Copy link
Member

@eirikurn eirikurn commented Oct 8, 2024

Summary by CodeRabbit

  • New Features

    • Updated version to 1.4.4 for both iOS and Android applications.
    • Introduced Slack error notifications for build workflows, enhancing communication on build statuses.
  • Bug Fixes

    • Improved notification settings for build success and failure events.
  • Chores

    • Adjusted publishing configurations for iOS and Android workflows to streamline notification processes.

@eirikurn eirikurn requested a review from a team as a code owner October 8, 2024 09:20
Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

Walkthrough

The pull request includes updates to versioning and notification configurations across multiple files for an Android and iOS application. The build.gradle file for Android and the Info.plist for iOS have both been modified to reflect a new version number, changing from "1.4.3" to "1.4.4". Additionally, the codemagic.yaml file has been updated to enhance Slack notification settings for build processes, integrating new error reporting configurations for both platforms.

Changes

File Path Change Summary
apps/native/app/android/app/build.gradle Updated versionName from "1.4.3" to "1.4.4" in android.defaultConfig.
apps/native/app/ios/IslandApp/Info.plist Updated CFBundleShortVersionString from "1.4.3" to "1.4.4".
codemagic.yaml Added slack_errors anchor for Slack notifications; updated publishing configurations for iOS and Android workflows to include this anchor.

Possibly related PRs

Suggested labels

automerge

Suggested reviewers

  • snaerseljan

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
codemagic.yaml (2)

98-104: LGTM! Consider adding more context to error notifications.

The new slack_errors anchor is well-configured for error reporting. Disabling success notifications is a good choice to reduce noise in the Slack channel.

Consider adding more context to the error notifications, such as including the build number or a link to the build logs. This can help with quicker troubleshooting. For example:

slack:
  channel: '#team-app-builds'
  notify:
    success: false
    failure: true
  message: |-
    Build ${CM_BUILD_NUMBER} failed.
    Build URL: ${CM_BUILD_URL}

206-208: LGTM! Consider unifying Slack configurations across all workflows.

The addition of the slack_errors anchor to both Android workflows successfully integrates Slack error reporting for Android builds, aligning with the PR objective.

For better consistency across the entire configuration, consider unifying the Slack notification approach for all workflows (iOS and Android, prod and dev). You could either:

  1. Use the slack_errors anchor for all workflows, including dev-app-ios.
  2. Create separate anchors for prod and dev configurations if different notification settings are needed.

This would make the configuration more maintainable and easier to understand at a glance.

Also applies to: 234-236

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 0a169cb and c194566.

📒 Files selected for processing (3)
  • apps/native/app/android/app/build.gradle (1 hunks)
  • apps/native/app/ios/IslandApp/Info.plist (1 hunks)
  • codemagic.yaml (5 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
apps/native/app/android/app/build.gradle (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
apps/native/app/ios/IslandApp/Info.plist (1)

Pattern apps/**/*: "Confirm that the code adheres to the following:

  • NextJS best practices, including file structure, API routes, and static generation methods.
  • Efficient state management and server-side rendering techniques.
  • Optimal use of TypeScript for component and utility type safety."
🔇 Additional comments (4)
apps/native/app/ios/IslandApp/Info.plist (1)

20-20: Version update looks good.

The CFBundleShortVersionString has been correctly updated from 1.4.3 to 1.4.4, which aligns with the PR objective of bumping the app version.

Let's ensure this version update is consistent across the project:

✅ Verification successful

Version consistency confirmed.

The CFBundleShortVersionString in iOS and the versionName in Android have been correctly updated to 1.4.4. No inconsistencies found across the project.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for version consistency across iOS and Android files

# Check iOS Info.plist
echo "iOS version:"
grep -A 1 "CFBundleShortVersionString" apps/native/app/ios/IslandApp/Info.plist

# Check Android build.gradle
echo "Android version:"
grep "versionName" apps/native/app/android/app/build.gradle

# Check any other potential version files
echo "Other potential version files:"
grep -r "1.4.4" apps/native --include="*.json" --include="*.xml" --include="*.gradle" --exclude="**/build/**"

Length of output: 750

apps/native/app/android/app/build.gradle (1)

106-106: Version update looks good, consider updating versionCode fallback

The update of versionName to "1.4.4" is consistent with the PR objectives. Good job on incrementing the patch version.

Consider updating the fallback value in getMyVersionCode(143) to 144 to match the new version name:

-        versionCode getMyVersionCode(143)
+        versionCode getMyVersionCode(144)

Please ensure that this version update is reflected in any relevant documentation, release notes, or other configuration files that may reference the app version.

✅ Verification successful

Version update confirmed and consistent

The update of versionName to "1.4.4" is consistent with the PR objectives. Good job on incrementing the patch version.

Consider updating the fallback value in getMyVersionCode(143) to 144 to match the new version name:

-        versionCode getMyVersionCode(143)
+        versionCode getMyVersionCode(144)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of the old version number
rg --type-add 'plist:*.plist' -t gradle -t plist -t yaml '1\.4\.3'

Length of output: 68


Script:

#!/bin/bash
# Search for other occurrences of the old version number
rg -t gradle -t plist -t yaml '1\.4\.3'

Length of output: 71


Script:

#!/bin/bash
# Search for other occurrences of the old version number in gradle and yaml files
rg -t gradle -t yaml '1\.4\.3'

# Search for the old version number in plist files by specifying the file pattern
rg --glob '*.plist' '1\.4\.3'

Length of output: 64

codemagic.yaml (2)

142-142: LGTM! Slack error reporting integrated for iOS production builds.

The addition of the slack_errors anchor to the publishing configuration for the prod-app-ios workflow successfully integrates Slack error reporting for iOS production builds. This change aligns with the PR objective of sending build errors to Slack.


172-175: LGTM! Confirm the intention behind different notification settings for dev builds.

The Slack channel has been updated to '#team-app-builds', aligning with the new slack_errors anchor. However, the notification settings for the dev app differ from the production configuration:

  1. Success notifications are enabled for dev builds but disabled for production builds.
  2. The slack_errors anchor is not used here, unlike in the production workflow.

Could you confirm if these differences are intentional? If so, it might be helpful to add a comment explaining the reasoning behind the different notification strategies for dev and production builds.

Copy link
Contributor

@thoreyjona thoreyjona left a comment

Choose a reason for hiding this comment

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

LGTM

@eirikurn eirikurn added the deprecated:automerge (Disabled) Merge this PR as soon as all checks pass label Oct 8, 2024
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.87%. Comparing base (6ce1b55) to head (c8c473f).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #16309   +/-   ##
=======================================
  Coverage   36.87%   36.87%           
=======================================
  Files        6801     6801           
  Lines      140605   140605           
  Branches    39972    39972           
=======================================
  Hits        51852    51852           
  Misses      88753    88753           
Flag Coverage Δ
air-discount-scheme-backend 54.04% <ø> (ø)
air-discount-scheme-web 0.00% <ø> (ø)
api 3.37% <ø> (ø)
api-domains-air-discount-scheme 36.90% <ø> (ø)
api-domains-assets 26.71% <ø> (ø)
api-domains-auth-admin 48.77% <ø> (ø)
api-domains-communications 39.90% <ø> (ø)
api-domains-criminal-record 47.96% <ø> (ø)
api-domains-driving-license 44.39% <ø> (ø)
api-domains-education 31.48% <ø> (ø)
api-domains-health-insurance 34.83% <ø> (ø)
api-domains-mortgage-certificate 35.67% <ø> (ø)
api-domains-payment-schedule 41.13% <ø> (ø)
application-api-files 57.97% <ø> (ø)
application-core 71.29% <ø> (-0.25%) ⬇️
application-system-api 41.66% <ø> (+<0.01%) ⬆️
application-template-api-modules 24.28% <ø> (-0.01%) ⬇️
application-templates-accident-notification 29.44% <ø> (ø)
application-templates-car-recycling 3.12% <ø> (ø)
application-templates-criminal-record 26.63% <ø> (ø)
application-templates-driving-license 18.40% <ø> (ø)
application-templates-estate 12.32% <ø> (ø)
application-templates-example-payment 25.41% <ø> (ø)
application-templates-financial-aid 14.34% <ø> (ø)
application-templates-general-petition 23.68% <ø> (ø)
application-templates-health-insurance 26.62% <ø> (ø)
application-templates-inheritance-report 6.45% <ø> (ø)
application-templates-marriage-conditions 15.23% <ø> (ø)
application-templates-mortgage-certificate 43.96% <ø> (ø)
application-templates-parental-leave 30.03% <ø> (ø)
application-types 6.71% <ø> (ø)
application-ui-components 1.28% <ø> (ø)
application-ui-shell 21.27% <ø> (ø)
auth-nest-tools 29.84% <ø> (ø)
auth-react 22.77% <ø> (ø)
clients-charge-fjs-v2 24.11% <ø> (ø)
clients-driving-license 40.63% <ø> (ø)
clients-driving-license-book 43.77% <ø> (ø)
clients-financial-statements-inao 49.29% <ø> (ø)
clients-license-client 1.83% <ø> (ø)
clients-middlewares 73.13% <ø> (ø)
clients-regulations 42.76% <ø> (ø)
clients-rsk-company-registry 29.76% <ø> (ø)
clients-syslumenn 49.49% <ø> (ø)
cms 0.43% <ø> (ø)
cms-translations 39.03% <ø> (ø)
contentful-apps 5.57% <ø> (ø)
download-service 44.01% <ø> (ø)
financial-aid-backend 56.39% <ø> (ø)
financial-aid-shared 19.03% <ø> (ø)
icelandic-names-registry-backend 53.97% <ø> (ø)
infra-nest-server 48.17% <ø> (ø)
island-ui-core 28.44% <ø> (ø)
judicial-system-api 18.29% <ø> (ø)
judicial-system-backend 55.17% <ø> (ø)
judicial-system-web 27.96% <ø> (ø)
license-api 42.60% <ø> (+0.07%) ⬆️
nest-audit 68.20% <ø> (ø)
nest-feature-flags 51.46% <ø> (ø)
nest-problem 45.85% <ø> (ø)
nest-swagger 51.71% <ø> (ø)
portals-admin-regulations-admin 1.88% <ø> (ø)
portals-core 16.15% <ø> (ø)
reference-backend 49.79% <ø> (ø)
services-auth-admin-api 52.12% <ø> (ø)
services-auth-delegation-api 57.73% <ø> (+0.06%) ⬆️
services-auth-ids-api 51.70% <ø> (ø)
services-auth-personal-representative 45.38% <ø> (-0.04%) ⬇️
services-auth-personal-representative-public 41.51% <ø> (-0.02%) ⬇️
services-auth-public-api 49.21% <ø> (ø)
services-documents 60.58% <ø> (ø)
services-endorsements-api 55.03% <ø> (ø)
services-sessions 65.31% <ø> (ø)
services-university-gateway 48.35% <ø> (ø)
services-user-notification 47.04% <ø> (+0.02%) ⬆️
services-user-profile 62.07% <ø> (-0.03%) ⬇️
shared-components 27.65% <ø> (ø)
shared-form-fields 31.59% <ø> (ø)
shared-utils 27.90% <ø> (ø)
skilavottord-ws 24.24% <ø> (ø)
web 1.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ce1b55...c8c473f. Read the comment docs.

@datadog-island-is
Copy link

datadog-island-is bot commented Oct 8, 2024

Datadog Report

All test runs e7713c3 🔗

79 Total Test Services: 0 Failed, 77 Passed
❄️ 1 with New Flaky
🔻 Test Sessions change in coverage: 3 decreased, 2 increased, 195 no change

Test Services
This report shows up to 10 services
Service Name Failed Known Flaky New Flaky Passed Skipped Total Time Code Coverage Change Test Service View
services-auth-admin-api 0 0 1 128 0 3m 10.21s 1 no change Link
air-discount-scheme-backend 0 0 0 81 0 32.2s N/A Link
air-discount-scheme-web 0 0 0 2 0 8.08s N/A Link
api 0 0 0 4 0 2.8s N/A Link
api-domains-air-discount-scheme 0 0 0 6 0 19.08s N/A Link
api-domains-assets 0 0 0 3 0 12.04s N/A Link
api-domains-auth-admin 0 0 0 18 0 14.25s N/A Link
api-domains-communications 0 0 0 5 0 33.63s N/A Link
api-domains-criminal-record 0 0 0 5 0 10.32s N/A Link
api-domains-driving-license 0 0 0 23 0 29.58s N/A Link

🔻 Code Coverage Decreases vs Default Branch (3)

  • application-core - jest 79.36% (-0.1%) - Details
  • services-user-profile - jest 52.72% (-0.02%) - Details
  • services-auth-personal-representative - jest 43.98% (-0.02%) - Details

@kodiakhq kodiakhq bot merged commit 9d156e4 into main Oct 8, 2024
211 checks passed
@kodiakhq kodiakhq bot deleted the codemagic-slack-errors branch October 8, 2024 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated:automerge (Disabled) Merge this PR as soon as all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants