You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2023/08/28 14:59:47 UTC

[GitHub] [airflow] Lee-W opened a new pull request, #33825: feat(providers/microsoft): add DefaultAzureCredential support to AzureContainerRegistryHook

Lee-W opened a new pull request, #33825:
URL: https://github.com/apache/airflow/pull/33825

   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33825:
URL: https://github.com/apache/airflow/pull/33825#issuecomment-1698795945

   > Right - this is a "Real" problem now you see.
   
   Got it. Just get it fixed. Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #33825:
URL: https://github.com/apache/airflow/pull/33825#issuecomment-1697158662

   The static check seems to be canceled again.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] eladkal commented on a diff in pull request #33825: feat(providers/microsoft): add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal commented on code in PR #33825:
URL: https://github.com/apache/airflow/pull/33825#discussion_r1308422283


##########
airflow/providers/microsoft/azure/provider.yaml:
##########
@@ -85,6 +84,7 @@ dependencies:
   #   See issue https://github.com/apache/airflow/issues/30199
   - azure-mgmt-containerinstance>=7.0.0,<9.0.0
   - azure-mgmt-datafactory>=1.0.0,<2.0
+  - azure-mgmt-containerregistry>=8.0.0

Review Comment:
   please place this above line 83
   It's not part of the TODO block



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] pankajastro merged pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "pankajastro (via GitHub)" <gi...@apache.org>.
pankajastro merged PR #33825:
URL: https://github.com/apache/airflow/pull/33825


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on a diff in pull request #33825: feat(providers/microsoft): add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #33825:
URL: https://github.com/apache/airflow/pull/33825#discussion_r1308280754


##########
airflow/providers/microsoft/azure/hooks/container_registry.py:
##########
@@ -40,6 +43,24 @@ class AzureContainerRegistryHook(BaseHook):
     conn_type = "azure_container_registry"
     hook_name = "Azure Container Registry"
 
+    @staticmethod
+    def get_connection_form_widgets() -> dict[str, Any]:
+        """Returns connection widgets to add to connection form."""
+        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import StringField
+
+        return {
+            "subscription_id": StringField(
+                lazy_gettext("Subscription ID (optional)"),
+                widget=BS3TextFieldWidget(),
+            ),
+            "resource_group": StringField(
+                lazy_gettext("Resource group name (optional)"),
+                widget=BS3TextFieldWidget(),
+            ),
+        }

Review Comment:
   Sure! Just updated these 2 fields



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #33825: feat(providers/microsoft): add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #33825:
URL: https://github.com/apache/airflow/pull/33825#discussion_r1307720752


##########
airflow/providers/microsoft/azure/hooks/container_registry.py:
##########
@@ -40,6 +43,24 @@ class AzureContainerRegistryHook(BaseHook):
     conn_type = "azure_container_registry"
     hook_name = "Azure Container Registry"
 
+    @staticmethod
+    def get_connection_form_widgets() -> dict[str, Any]:
+        """Returns connection widgets to add to connection form."""
+        from flask_appbuilder.fieldwidgets import BS3TextFieldWidget
+        from flask_babel import lazy_gettext
+        from wtforms import StringField
+
+        return {
+            "subscription_id": StringField(
+                lazy_gettext("Subscription ID (optional)"),
+                widget=BS3TextFieldWidget(),
+            ),
+            "resource_group": StringField(
+                lazy_gettext("Resource group name (optional)"),
+                widget=BS3TextFieldWidget(),
+            ),
+        }

Review Comment:
   Would be nice to have information about this extra fields into the documentation https://github.com/apache/airflow/blob/b82ce61285f3f4f0c7eccb2c3effaef53c9fb84e/docs/apache-airflow-providers-microsoft-azure/connections/acr.rst?plain=1#L44-L56



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #33825:
URL: https://github.com/apache/airflow/pull/33825#issuecomment-1697280719

   Right - this is a "Real" problem now you see.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on a diff in pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #33825:
URL: https://github.com/apache/airflow/pull/33825#discussion_r1308457908


##########
airflow/providers/microsoft/azure/provider.yaml:
##########
@@ -85,6 +84,7 @@ dependencies:
   #   See issue https://github.com/apache/airflow/issues/30199
   - azure-mgmt-containerinstance>=7.0.0,<9.0.0
   - azure-mgmt-datafactory>=1.0.0,<2.0
+  - azure-mgmt-containerregistry>=8.0.0

Review Comment:
   Sure! Just updated it



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #33825: Add DefaultAzureCredential support to AzureContainerRegistryHook

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #33825:
URL: https://github.com/apache/airflow/pull/33825#issuecomment-1697242780

   > The static check seems to be canceled again.
   
   Seems like it took 12 minutes to just "start" installing the environment for mypy checks. So this is likely something flaky/environmental:
   
   ```
   Tue, 29 Aug 2023 09:18:29 GMT
   [INFO] This may take a few minutes...
   Tue, 29 Aug 2023 09:30:52 GMT
   [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks.
   ```
   
   
   > This takes usually 20 seconds or so on public runners
   
   ```
   Tue, 29 Aug 2023 08:59:55 GMT
   [INFO] Installing environment for https://github.com/thlorenz/doctoc.git.
   Tue, 29 Aug 2023 08:59:55 GMT
   [INFO] Once installed this environment will be reused.
   Tue, 29 Aug 2023 08:59:55 GMT
   [INFO] This may take a few minutes...
   Tue, 29 Aug 2023 09:00:15 GMT
   [INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks.
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org