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

app_service - support preview version 21 for java_version #26304

Merged
merged 6 commits into from
Dec 6, 2024

Conversation

computerlove
Copy link
Contributor

@computerlove computerlove commented Jun 12, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

Add Java 21 as a allowed value for webapp services.

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run unit tests with my changes locally.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_linux_web_app - Support Java 21. (#25490)
  • azurerm_windows_web_app - Support Java 21. (#25490)
  • azurerm_linux_function_app - Support Java 21. (#24754)
  • azurerm_windows_function_app - Support Java 21. (#24754)

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

fixes #25490
fixes #24754

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @computerlove! Thanks for this PR but we've got some failing tests because the new values wasn't added to the correct schema or the tests aren't testing the right resource.

=== RUN   TestAccAppService_windowsJava21Java
=== PAUSE TestAccAppService_windowsJava21Java
=== CONT  TestAccAppService_windowsJava21Java
    testcase.go:113: Step 1/2 error: Error running pre-apply refresh: exit status 1
        Error: expected site_config.0.java_version to be one of ["1.7" "1.8" "11"], got 21
          with azurerm_app_service.test,
          on terraform_plugin_test.tf line 48, in resource "azurerm_app_service" "test":
          48:     java_version           = "21"
--- FAIL: TestAccAppService_windowsJava21Java (11.10s)
=== CONT  TestAccAppService_windowsJava17Java
    testcase.go:113: Step 1/2 error: Error running pre-apply refresh: exit status 1
        Error: expected site_config.0.java_version to be one of ["1.7" "1.8" "11"], got 17
          with azurerm_app_service.test,
          on terraform_plugin_test.tf line 48, in resource "azurerm_app_service" "test":
          48:     java_version           = "17"
--- FAIL: TestAccAppService_windowsJava17Java (11.67s)

internal/services/web/app_service_resource_test.go Outdated Show resolved Hide resolved
@computerlove
Copy link
Contributor Author

@mbfrahry When I update the conflict in CHANGELOG.md, should the change be amended and force pushed, or is a merge commit OK?

@stephybun
Copy link
Member

@computerlove, we take care of updating the CHANGELOG.md after a PR has been merged, so if there are any changes in there they should be removed. We recommend rebasing your changes on top of main, but merging changes from main into your branch is also acceptable.

@computerlove
Copy link
Contributor Author

Ok, I have rebased and pushed with not changes to CHANGELOG.md.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @computerlove! I think we're also missing a test for linux function app?

@computerlove
Copy link
Contributor Author

Yeah, looks like it.
Added one now.

@computerlove computerlove requested a review from stephybun August 14, 2024 13:08
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Most of the tests look good, just one is failing, the Linux Web App test needs to have the check updated

@groupcard-ruben-timmermans

any update?

@computerlove
Copy link
Contributor Author

No.
Someone have to find out what After applying this test step, the non-refresh plan was not empty. means and why it appears on the new test for java 21, and not for the identical test for java 17.

@StefanSchoof
Copy link
Contributor

My interpretation is that, the test is apply the changes and then makes a terraform plan -refresh=false and expects that the plan need no changes. (But why this happens only for java 21, I have no clue)

@katbyte katbyte requested a review from a team as a code owner November 14, 2024 00:08
Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Hi @computerlove - Thanks for this PR. Looking over there's some additional changes needed to accommodate the new version, which I've noted for you below. If you can take a look it should get the test passing, and the fx_version should then be correctly set to JAVA|21-java21 and the tests should pass.

website/docs/r/function_app.html.markdown Outdated Show resolved Hide resolved
website/docs/r/linux_function_app.html.markdown Outdated Show resolved Hide resolved
@computerlove
Copy link
Contributor Author

computerlove commented Nov 28, 2024 via email

@jackofallops jackofallops changed the title Allow java_version 21 for app services. fixes #25490 app_service - support preview version 21 for java_version Nov 28, 2024
@computerlove
Copy link
Contributor Author

marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccLinuxWebApp_withJre21Java' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccLinuxWebApp_withJre21Java -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccLinuxWebApp_withJre21Java
=== PAUSE TestAccLinuxWebApp_withJre21Java
=== CONT  TestAccLinuxWebApp_withJre21Java
--- PASS: TestAccLinuxWebApp_withJre21Java (251.43s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    251.461s
marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccLinuxFunctionApp_appStackJava21' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccLinuxFunctionApp_appStackJava21 -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccLinuxFunctionApp_appStackJava21
=== PAUSE TestAccLinuxFunctionApp_appStackJava21
=== CONT  TestAccLinuxFunctionApp_appStackJava21
--- PASS: TestAccLinuxFunctionApp_appStackJava21 (313.70s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    313.723s
marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccLinuxWebApp_withJre17Java' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccLinuxWebApp_withJre17Java -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccLinuxWebApp_withJre17Java
=== PAUSE TestAccLinuxWebApp_withJre17Java
=== CONT  TestAccLinuxWebApp_withJre17Java
--- PASS: TestAccLinuxWebApp_withJre17Java (251.59s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    251.611s
marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccWindowsFunctionApp_appStackJava17' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccWindowsFunctionApp_appStackJava17 -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccWindowsFunctionApp_appStackJava17
=== PAUSE TestAccWindowsFunctionApp_appStackJava17
=== CONT  TestAccWindowsFunctionApp_appStackJava17
--- PASS: TestAccWindowsFunctionApp_appStackJava17 (309.14s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    309.160s
marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccWindowsFunctionApp_appStackJava21' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccWindowsFunctionApp_appStackJava21 -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccWindowsFunctionApp_appStackJava21
=== PAUSE TestAccWindowsFunctionApp_appStackJava21
=== CONT  TestAccWindowsFunctionApp_appStackJava21
--- PASS: TestAccWindowsFunctionApp_appStackJava21 (318.06s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    318.085s
marlil@marlil:~/src/terraform-provider-azurerm$ make acctests SERVICE='appservice' TESTARGS='-run=TestAccWindowsWebApp_withJava21Embedded' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/appservice -run=TestAccWindowsWebApp_withJava21Embedded -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccWindowsWebApp_withJava21Embedded
=== PAUSE TestAccWindowsWebApp_withJava21Embedded
=== CONT  TestAccWindowsWebApp_withJava21Embedded
--- PASS: TestAccWindowsWebApp_withJava21Embedded (253.43s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice    253.451s

Copy link

@erboucherie erboucherie left a comment

Choose a reason for hiding this comment

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

Sounds good to me .

Copy link
Member

@jackofallops jackofallops left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @computerlove - This LGTM now 👍

@jackofallops jackofallops dismissed stale reviews from katbyte, stephybun, and mbfrahry December 6, 2024 08:38

stale

@jackofallops
Copy link
Member

GHA Unit Test failure due to unrelated test code on merge comparison branch that has been fixed in main.
image

@jackofallops jackofallops merged commit aa8b3ee into hashicorp:main Dec 6, 2024
33 of 34 checks passed
@github-actions github-actions bot added this to the v4.14.0 milestone Dec 6, 2024
jackofallops added a commit that referenced this pull request Dec 6, 2024
@computerlove computerlove deleted the java-21 branch December 6, 2024 09:03
jackofallops added a commit that referenced this pull request Dec 13, 2024
* Update CHANGELOG.md for #26304

* Update CHANGELOG.md for #28211

* Update for #28016

* Update for #28139

* Update for #27776

* Update for #28227

* Update for #28080

* Update for #28228

* Update for #27915

* reword nginx api upgrade

* Update for #28160

* Update for #28043

* run changelog-update-for-release.sh

---------

Co-authored-by: stephybun <[email protected]>
Co-authored-by: kt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Java 21 for azurerm_linux_web_app Java 21 support for azurerm_linux_function_app
9 participants