Skip to content

Commit 13b7ba4

Browse files
authored
Add information about AuthContext context class with link to api doc (#159)
1 parent 3a38dcf commit 13b7ba4

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: "Publish Docs"
2+
3+
on:
4+
# Auto-trigger this workflow on tag creation
5+
push:
6+
tags:
7+
- 'v*.*.*'
8+
# Auto-trigger this workflow on merge to main changes in docs/** folder
9+
pull_request_target:
10+
types:
11+
- closed
12+
branches:
13+
- main
14+
paths:
15+
- 'docs/**'
16+
17+
env:
18+
RTDS_ADS_PROJECT: https://readthedocs.org/api/v3/projects/accelerated-data-science
19+
RTDS_ADS_TOKEN: ${{ secrets.RTDS_ADS_TOKEN }}
20+
21+
jobs:
22+
build-n-publish:
23+
name: Build and publish Docs 📖 to Readthedocs
24+
runs-on: ubuntu-latest
25+
26+
steps:
27+
- name: When PR ✅ merged - Trigger Readthedocs build
28+
if: github.event_name == 'pull_request_target' && github.event.pull_request.merged == true
29+
run: |
30+
curl \
31+
-X POST \
32+
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/latest/builds/
33+
- name: When tag 🏷️ pushed - Trigger Readthedocs build
34+
if: github.event_name == 'push' && startsWith(github.ref_name, 'v')
35+
run: |
36+
# add 10 minutes wait time for readthedocs see freshly created tag
37+
sleep 10m
38+
curl \
39+
-X POST \
40+
-H "Authorization: Token $RTDS_ADS_TOKEN" $RTDS_ADS_PROJECT/versions/${{ github.ref_name }}/builds/

.github/workflows/run-unittests-default_setup.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: tests/unitary/default_setup/**
22

33
on:
4-
push:
4+
pull_request:
55
branches:
66
- main
77
- 'release/**'
@@ -10,9 +10,6 @@ on:
1010
- 'ads/**'
1111
- setup.py
1212
- '**requirements.txt'
13-
- '!docs/**'
14-
15-
pull_request:
1613

1714
# Cancel in progress workflows on pull_requests.
1815
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value

.github/workflows/run-unittests.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: tests/unitary/**
22

33
on:
4-
push:
4+
pull_request:
55
branches:
66
- main
77
- 'release/**'
@@ -10,9 +10,6 @@ on:
1010
- 'ads/**'
1111
- setup.py
1212
- '**requirements.txt'
13-
- '!docs/**'
14-
15-
pull_request:
1613

1714
# Cancel in progress workflows on pull_requests.
1815
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
@@ -163,7 +160,7 @@ jobs:
163160
# Calculate overall coverage and update body message
164161
COV=$(grep -E 'pc_cov' htmlcov/index.html | cut -d'>' -f 2 | cut -d'%' -f 1)
165162
if [[ ! -z $COV ]]; then
166-
if [[ $COV < 50 ]]; then COLOR=red; elif [[ $COV < 80 ]]; then COLOR=yellow; else COLOR=green; fi
163+
if [[ $COV -lt 50 ]]; then COLOR=red; elif [[ $COV -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
167164
echo COV_BODY="$COV_BODY_INTRO ![Coverage-$COV%](https://img.shields.io/badge/coverage-$COV%25-$COLOR)" >> $GITHUB_ENV
168165
fi
169166
@@ -174,7 +171,7 @@ jobs:
174171
175172
# Prepare default diff body text
176173
DIFF_BODY_INTRO="📌 Cov diff with **${{ env.COMPARE_BRANCH }}**:\n\n"
177-
echo DIFF_BODY="$BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
174+
echo DIFF_BODY="$DIFF_BODY_INTRO No success to gather report. 😿" >> $GITHUB_ENV
178175
179176
# Prepare file paths to coverage xml files
180177
# Filenames taken from job.test last step with name - "Save coverage files"
@@ -193,7 +190,7 @@ jobs:
193190
--compare-branch=origin/${{ env.COMPARE_BRANCH }} | grep "No lines");
194191
echo DIFF_BODY="$DIFF_BODY_INTRO $DIFF_INFO">> $GITHUB_ENV
195192
else
196-
if [[ $DIFF < 50 ]]; then COLOR=red; elif [[ $DIFF < 80 ]]; then COLOR=yellow; else COLOR=green; fi
193+
if [[ $DIFF -lt 50 ]]; then COLOR=red; elif [[ $DIFF -lt 80 ]]; then COLOR=yellow; else COLOR=green; fi
197194
echo DIFF_BODY="$DIFF_BODY_INTRO ![Coverage-$DIFF%](https://img.shields.io/badge/coverage-$DIFF%25-$COLOR)" >> $GITHUB_ENV
198195
fi
199196

docs/source/user_guide/configuration/authentication.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,5 @@ In the this example, the default authentication uses API keys specified with the
7878
set_auth("api_key") # default signer is set to api_key
7979
os_auth = authutil.resource_principal() # use resource principal to as the preferred way to access object store
8080
81+
``AuthContext`` context class can also be used to specify the desired type of authentication. It supports API key configuration, resource principal, and instance principal authentication, as well as predefined signers, callable signers, or API keys configurations from specified locations. See `API Documentation <../../ads.common.html#ads.common.auth.AuthContext>`__ for more details.
82+

0 commit comments

Comments
 (0)