vchiapaikeo opened a new pull request, #30301:
URL: https://github.com/apache/airflow/pull/30301

   <!--
   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:
   
   
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   closes: https://github.com/apache/airflow/issues/28465
   
   ### Testing
   
   Add two Jenkins connections - 
   
   <img width="1440" alt="image" 
src="https://user-images.githubusercontent.com/9200263/227722072-950dd89d-e928-4edb-9a7a-6db4f501c163.png";>
   
   One with https:
   
   <img width="1440" alt="image" 
src="https://user-images.githubusercontent.com/9200263/227722304-80073b33-f55c-444a-8a1b-d08ec4dc93c3.png";>
   
   And the other without:
   
   <img width="1440" alt="image" 
src="https://user-images.githubusercontent.com/9200263/227722321-93073684-cc12-4aae-b3e9-eabf78a2aadb.png";>
   
   
   Test out connections in local python repl:
   ```
   root@a0a6c7b4e782:/opt/airflow# python
   Python 3.9.16 (main, Mar  1 2023, 15:47:56)
   [GCC 10.2.1 20210110] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> from airflow.secrets .metastore import MetastoreBackend
   >>> backend = MetastoreBackend()
   >>> conn = backend.get_connection(conn_id="jenkins1")
   /opt/airflow/airflow/models/dagrun.py:131 RemovedIn20Warning: [31mDeprecated 
API features detected! These feature(s) are not compatible with SQLAlchemy 2.0. 
[32mTo prevent incompatible upgrades prior to updating applications, ensure 
requirements files are pinned to "sqlalchemy<2.0". [36mSet environment variable 
SQLALCHEMY_WARN_20=1 to show all deprecation warnings.  Set environment 
variable SQLALCHEMY_SILENCE_UBER_WARNING=1 to silence this message.[0m 
(Background on SQLAlchemy 2.0 at: https://sqlalche.me/e/b8d9)
   >>>
   >>> conn.extra_dejson.get("use_https")
   True
   >>> conn.__dict__
   {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 
0x7f28d3c2e700>, 'id': 229, 'conn_type': 'jenkins', 'description': '', 
'schema': '', 'port': 8080, 'is_extra_encrypted': True, '_extra': 
'gAAAAABkHvrPg-cFw74KBDHi2TAh-BYZMCd2P3UgYdNLAdFm6o3Q3YGqnPVo4ikNAssuppjYsRTiicZcDSUFp2s3Mq3iD_eI3iP7oXCQeV7y3usnT53hhPw=',
 '_password': 
'gAAAAABkHvrPtfwUF2cdzJW-W6TLlcA6UB9_0ZAlPS1HlQHsHjLTuZJ8oWzblVTYS8hF0h-PH6TepyFwFKRrnfyPPZNls_IjHw==',
 'conn_id': 'jenkins1', 'host': 'jenkins.example.com', 'login': 'jenkins', 
'is_encrypted': True}
   >>>
   >>> conn = backend.get_connection(conn_id="jenkins2")
   >>> conn.extra_dejson.get("use_https")
   False
   >>> conn.__dict__
   {'_sa_instance_state': <sqlalchemy.orm.state.InstanceState object at 
0x7f28d3c2ea00>, 'id': 230, 'conn_type': 'jenkins', 'description': '', 
'schema': '', 'port': 8080, 'is_extra_encrypted': True, '_extra': 
'gAAAAABkHv3AQ9jh_6jZtvetDHK90UMLTgD8MZr0rwlGe4ETqVVDeyxFh5-8E1ujEhMi2v3WaaemkgU1D9v1DKrSOMPfZDiVgMzyg3HQ-c7pCb7iRuy3M-c=',
 '_password': 
'gAAAAABkHv3AjJOpmi_80LPLEWTbEPShkA7zv7IdjKaBDjDcafdmMUrzJsRj7wO_OBtcRJC1k2o-ByGg2k69RKsv3Bn2vlluiQ==',
 'conn_id': 'jenkins2', 'host': 'jenkins.example.com', 'login': 'jenkins', 
'is_encrypted': True}
   ```
   
   ---
   **^ 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to