Skip to content

Conversation

@vchiapaikeo
Copy link
Contributor

closes: #28465

Testing

Add two Jenkins connections -

image

One with https:

image

And the other without:

image

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 for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
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.

@vchiapaikeo vchiapaikeo force-pushed the vchiapaikeo/jenkins-hook-v1 branch 2 times, most recently from 8004115 to 5734fb4 Compare March 25, 2023 14:27
@vchiapaikeo vchiapaikeo marked this pull request as ready for review March 25, 2023 14:27
@vchiapaikeo vchiapaikeo force-pushed the vchiapaikeo/jenkins-hook-v1 branch from 5734fb4 to 8811912 Compare March 25, 2023 17:15
@vchiapaikeo vchiapaikeo force-pushed the vchiapaikeo/jenkins-hook-v1 branch from 8811912 to b996b11 Compare March 25, 2023 18:19
@eladkal eladkal changed the title [jenkins] Fix connection intake on https JenkinsHook fix connection intake on https Mar 25, 2023
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.

Airflow 2.2.4 Jenkins Connection - unable to set as the hook expects to be

2 participants