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

chore: revert function app version updates #1483

Merged
merged 2 commits into from
Nov 18, 2024

Conversation

arealmaas
Copy link
Collaborator

@arealmaas arealmaas commented Nov 18, 2024

Description

For some reason the function app cannot be updated in Bicep. Reverting rest of the changes done to the upgrading of versions for the function app

Related Issue(s)

  • #{issue number}

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

Summary by CodeRabbit

  • New Features

    • Updated resource versions for Azure Function App settings and Slack Notifier function app to a more stable release.
  • Bug Fixes

    • Ensured consistent naming conventions and configurations across application settings without altering core functionality.

@arealmaas arealmaas requested review from a team as code owners November 18, 2024 13:52
Copy link
Contributor

coderabbitai bot commented Nov 18, 2024

📝 Walkthrough

Walkthrough

The pull request updates the version of several Azure resources in Bicep files for Function Apps. Specifically, it changes the siteconfig, applicationServicePlan, and functionApp resource versions from 2024-04-01 to 2023-12-01. While the resource versions are modified, the parameters and logic for app settings and other configurations remain unchanged.

Changes

File Path Change Summary
.azure/modules/functionApp/appSettings.bicep Updated siteconfig resource version from 2024-04-01 to 2023-12-01.
.azure/modules/functionApp/slackNotifier.bicep Updated applicationServicePlan and functionApp resource versions from 2024-04-01 to 2023-12-01.

Possibly related PRs

Suggested reviewers

  • knuhau

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 8468720 and d605e1c.

📒 Files selected for processing (2)
  • .azure/modules/functionApp/appSettings.bicep (1 hunks)
  • .azure/modules/functionApp/slackNotifier.bicep (1 hunks)
🔇 Additional comments (5)
.azure/modules/functionApp/appSettings.bicep (2)

Line range hint 14-18: Verify consistent version usage across dependent resources.

Since this is a version reversion, we should ensure all related Function App resources use the same API version.

Let's check for version consistency:

#!/bin/bash
# Description: Verify version consistency across related Function App resources

# Look for other Function App related resources that might need version alignment
echo "Checking for Function App related resources..."
rg 'Microsoft\.Web/(serverfarms|sites|functions)@202[34]' --type bicep -A 3

Line range hint 14-18: LGTM! Version downgrade looks correct.

The version downgrade to 2023-12-01 aligns with the PR objectives to resolve function app update issues.

Let's verify the version compatibility and support status:

✅ Verification successful

Version consistency confirmed across Function App resources

The version downgrade to 2023-12-01 is consistently applied across all Microsoft.Web/sites resources in the function app modules:

  • In appSettings.bicep: Both webApp and siteconfig resources use version 2023-12-01
  • In slackNotifier.bicep: The functionApp resource uses version 2023-12-01

Note: There is one instance of 2023-01-01 used for listing app settings, but this is an API version for a different operation and doesn't need alignment.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for version usage across Bicep files and validate Azure provider versions

# Check version consistency across all Bicep files
echo "Checking version usage across all Bicep files..."
rg -l 'Microsoft\.Web/sites(@|/config@)2023-12-01' --type bicep

# Check for any other Web/sites versions that might need alignment
echo "Checking for other Web/sites versions..."
rg -l 'Microsoft\.Web/sites(@|/config@)202[34]' --type bicep

Length of output: 520


Script:

#!/bin/bash
# Let's try a different approach without relying on file type detection
# Search for Web/sites version patterns in all files with .bicep extension

echo "Checking version patterns in Bicep files..."
find . -name "*.bicep" -type f -exec grep -l "Microsoft.Web/sites" {} \;

echo -e "\nChecking specific version patterns..."
for f in $(find . -name "*.bicep" -type f); do
  echo "=== $f ==="
  grep -A 2 "Microsoft.Web/sites" "$f" 2>/dev/null || true
done

Length of output: 9031

.azure/modules/functionApp/slackNotifier.bicep (3)

Line range hint 219-259: Consider using GA version for alert rule API.

The alert rule is using a preview version (2023-03-15-preview). Consider using the GA version for better stability, especially since this is a production monitoring component.

#!/bin/bash
# Description: Check alert rule API versions across the codebase

# Search for other alert rule definitions
rg "Microsoft.Insights/scheduledQueryRules@" -g "*.bicep"

# Look for any existing GA versions in use
ast-grep --pattern 'resource $_ '\''Microsoft.Insights/scheduledQueryRules@$_'\'' = {
  $$$
}'

83-83: Version reversion looks good, verify compatibility.

The version change from '2024-04-01' to '2023-12-01' aligns with the PR objective. This is a stable version that should resolve the function app update issues.

✅ Verification successful

Version change is isolated and consistent

The version change to '2023-12-01' for Microsoft.Web/serverfarms is the only instance in the codebase, making this a clean and isolated change. This confirms there are no version inconsistencies to address across other Bicep templates.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Azure provider version compatibility
# Check if this version is used consistently across other Bicep files

# Search for any other App Service Plan resource definitions
ast-grep --pattern 'resource $_ '\''Microsoft.Web/serverfarms@$_'\'' = {
  $$$
}'

# Search for version references in other files
rg "Microsoft.Web/serverfarms@" -g "*.bicep"

Length of output: 277


Script:

#!/bin/bash
# Let's try a different approach to find Bicep files and their content

# First, find all Bicep files
fd -e bicep

# Then search for App Service Plan definitions with version
rg "Microsoft.Web/serverfarms@" --type bicep

# Also check for any references to serverfarms in general
rg "Microsoft.Web/serverfarms" --type bicep

Length of output: 162


Script:

#!/bin/bash
# Let's try without file type specification since Bicep isn't recognized

# Find Bicep files first
fd -e bicep

# Then use these to search for App Service Plan definitions
rg "Microsoft.Web/serverfarms" .azure/

Length of output: 174


Line range hint 107-122: Consider enhancing security configuration.

While the configuration is functional, consider the following security improvements:

  1. Evaluate if publicNetworkAccess: 'Enabled' is necessary or if it can be restricted
  2. Consider adding IP restrictions in siteConfig if public access is required
  3. Consider adding minTlsVersion: '1.2' to enforce TLS security

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.

@arealmaas arealmaas changed the title Chore/revert slack notifier version 2 chore: revert function app version updates Nov 18, 2024
@arealmaas arealmaas merged commit bced96a into main Nov 18, 2024
19 of 20 checks passed
@arealmaas arealmaas deleted the chore/revert-slack-notifier-version-2 branch November 18, 2024 15:12
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.

2 participants