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

Report sync and bugfixes #13

Merged
merged 128 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
008b8d2
Fix metrics field exclusion bug
bryantgray Jan 20, 2022
47b41be
Enable report discovery and sync
bryantgray Jan 20, 2022
b50de0a
Remove the prefix from fields names in the resource schema and json s…
bryantgray Jan 24, 2022
cb95e45
Fix bug caused by shared references
bryantgray Jan 26, 2022
8caa8db
Use a tuple literal
bryantgray Jan 26, 2022
54eae0f
Add table-foreign-key-properties to stream metadata
bryantgray Jan 26, 2022
fb6f5b0
Add function to create nested JSON schema for core streams
bryantgray Jan 26, 2022
c2cf1be
Add tests for `create_nested_resource_schema`
bryantgray Jan 26, 2022
e285226
Refactor function to allow reuse with reports
bryantgray Jan 26, 2022
2532335
Fix tests after refactor
bryantgray Jan 26, 2022
f2299f9
Working sync for core streams
bryantgray Jan 27, 2022
e3ee4a1
Fix field exclusion and metadata bugs
bryantgray Jan 28, 2022
db030ed
Add ReportStream class, update PK names
bryantgray Jan 31, 2022
6a0a856
Remove flatten because schema is no longer flat
bryantgray Jan 31, 2022
b485e51
Fix primary key bug
bryantgray Jan 31, 2022
196d888
Require date as a segment
bryantgray Jan 31, 2022
e549e28
Fix ads stream bugs
bryantgray Feb 1, 2022
2eed2f6
Add remapping for ads in report
bryantgray Feb 1, 2022
e654e9f
WIP Incremental sync for report streams
bryantgray Feb 1, 2022
b29583f
Make state global
bryantgray Feb 2, 2022
bba91ab
Add hash of attributes and segments as PK for report streams
bryantgray Feb 2, 2022
a9e744a
Change reports to use the ReportStream class
bryantgray Feb 2, 2022
365a893
Change adgroupperformancereport to use report stream, don't write sta…
bryantgray Feb 2, 2022
73cbe8f
Make pylint happy
bryantgray Feb 3, 2022
2ec3107
Change fields-to-sync to tap-google-ads.api-field-names
bryantgray Feb 3, 2022
2c2e9d7
Merge remote-tracking branch 'origin/main' into report-sync
bryantgray Feb 3, 2022
eb3140e
Fix record hash and add tests for record hash
bryantgray Feb 3, 2022
d4cd071
Make inclusion automatic on foreign keys
bryantgray Feb 3, 2022
5a4b937
Add docstring to create_resource_schema
bryantgray Feb 3, 2022
b9d0d6a
Change metadate fields_to_sync to tap-google-ads.api-field-names, don't
bryantgray Feb 4, 2022
3df3b79
Add conversion window, Don't store the whole response in memory since
bryantgray Feb 7, 2022
175c33a
Enable `campaign_criteria_report`
bryantgray Feb 8, 2022
cf71a68
Fix field exclusion bug where one resource has the other in its
bryantgray Feb 8, 2022
e9fc3d2
Change multiple resource reports to use one resource for alpha
bryantgray Feb 10, 2022
cbfd27d
Change core sync to not load whole response in memory
bryantgray Feb 10, 2022
7942dce
Change query range to 1 day, Add logs, begin refactoring
bryantgray Feb 10, 2022
0c9d49d
Separate functionality into separate files
bryantgray Feb 11, 2022
0acdf10
Remove unused functions and variables
bryantgray Feb 11, 2022
59e93e3
WIP discovery refactor
bryantgray Feb 11, 2022
2a5240f
Move Required Config to init
dsprayberry Feb 14, 2022
0705d2e
remove reports.py after rename
dsprayberry Feb 14, 2022
46ba19b
Remove unused import
dsprayberry Feb 14, 2022
32eb68f
Qa/reports 1 (#14)
luandy64 Feb 15, 2022
e81c129
Use the pylint disable env var (#15)
luandy64 Feb 15, 2022
165dcac
Change single quotes to double quotes
dsprayberry Feb 14, 2022
e8e559a
Remove `format_field_names`
dsprayberry Feb 14, 2022
1f572ad
Ensure segmenting resources are accounted for in metadata
dsprayberry Feb 14, 2022
34ad10a
Pulled `format_field_names` into ReportStream class
dsprayberry Feb 14, 2022
668073b
Pulled `format_field_names` into BaseStream class
dsprayberry Feb 15, 2022
3459f0a
Refactor WIP; complete format_field_name moves in both base and repor…
dsprayberry Feb 15, 2022
d2fa09f
Refactor WIP; move metadata creation to base and report classes
dsprayberry Feb 15, 2022
9d25b55
Refactor WIP: Complete discovery refactoring
dsprayberry Feb 15, 2022
276ded7
Make pylint as happy as possible knowing it will never be pleased
dsprayberry Feb 15, 2022
e6eb714
First performance report update
bhtowles Feb 15, 2022
7f6d32e
Remove extra category assignment
dsprayberry Feb 16, 2022
e328925
Merge branch 'report-sync' of github.com:singer-io/tap-google-ads int…
bhtowles Feb 16, 2022
ee4ca72
disco test update, auto fields test added
bhtowles Feb 16, 2022
14274c2
Ran black
dsprayberry Feb 16, 2022
12d70b8
Add user_view_performance_report
dsprayberry Feb 16, 2022
053db6d
Update config with parallelized jobs and steps
Feb 16, 2022
82c17dc
trust the workspace attach to persist a file
Feb 16, 2022
38da4da
just copy env vars where needed
Feb 16, 2022
bb4f547
testing a test counter
Feb 16, 2022
8ecc301
Remove multiple-resource related code (#16)
luandy64 Feb 16, 2022
c30fbc4
Use `singer.utils.should_sync_field` to filter for selected fields
dsprayberry Feb 16, 2022
f4a4724
Add the user_view_performance_report to tests
dsprayberry Feb 16, 2022
f15dc0d
Write the json schema for date fields as datetimes
dsprayberry Feb 16, 2022
9491bb9
Compare datetime objects instead of strings (#17)
luandy64 Feb 16, 2022
69ca5bb
updates to auto, disoc, start tests
bhtowles Feb 16, 2022
8864f16
Merge branch 'report-sync' of github.com:singer-io/tap-google-ads int…
bhtowles Feb 16, 2022
843d92a
Add workarounds to get tests passing
dsprayberry Feb 16, 2022
7501b4a
Sort excluded streams
dsprayberry Feb 16, 2022
b7e5b5d
Merge branch 'report-sync' of github.com:singer-io/tap-google-ads int…
bhtowles Feb 16, 2022
f46ff7b
Update user_view to user_location_performation_report
dsprayberry Feb 16, 2022
cd1648b
auto field test passing with workaround
bhtowles Feb 16, 2022
e159b02
Adds failing tests for metadata bugs.
dsprayberry Feb 17, 2022
8b77b8e
Fix failing metadata tests
dsprayberry Feb 17, 2022
5a742e7
Ensure transformer filters out non-selected fields
dsprayberry Feb 17, 2022
6388e55
Update test expectations to allow null foreign keys
dsprayberry Feb 17, 2022
44ec6c7
Merge branch 'report-sync' of github.com:singer-io/tap-google-ads int…
bhtowles Feb 17, 2022
0ef0f6b
tests partial refactor for selecting streams/fields, add first report…
Feb 17, 2022
b92652f
Update reports test to check each report for automatic fields
dsprayberry Feb 17, 2022
ea473c4
Raise exception when report only has automatic fields selected
dsprayberry Feb 17, 2022
fd0a4a1
Clean up imports
dsprayberry Feb 17, 2022
d482706
increased test coverage for start date
bhtowles Feb 17, 2022
6ba7767
Merge branch 'report-sync' of github.com:singer-io/tap-google-ads int…
bhtowles Feb 17, 2022
9ea66d3
updates to auto fields test, simplify field selection in start date
bhtowles Feb 17, 2022
10b4ad3
fix automatic fields for core stream foreign keys
Feb 18, 2022
804145b
WIP start date test split out streams to test
bhtowles Feb 18, 2022
e24f741
Finalized start date test for Alpha
bhtowles Feb 18, 2022
3f0020f
Merge branch 'qa/parallelize-tests' into report-sync
Feb 18, 2022
123a3d7
fix the parallelism 9->6
Feb 18, 2022
a3265d3
just install required dependencies
Feb 18, 2022
e86aa11
don't count test
Feb 18, 2022
f61ccd1
fix pylint with variable reference
Feb 18, 2022
06d1969
Install pylint
luandy64 Feb 18, 2022
5b066f4
Show the tap installed correctly
luandy64 Feb 18, 2022
c7c8219
Revert "Show the tap installed correctly"
luandy64 Feb 18, 2022
a2fd394
Revert "Install pylint"
luandy64 Feb 18, 2022
9c7c3e8
Install tap-google-ads without `-e`, install dev dependencies
luandy64 Feb 18, 2022
4afa5b3
Bugs squashed: 17839, 17827
Feb 22, 2022
efd1b76
Bug squashed: TDL-17840
Feb 22, 2022
3690501
Failing assertions for TDL-17887
bhtowles Feb 22, 2022
a046de3
Regroup functions for readability, rename sync_* to sync, set currently
dsprayberry Feb 17, 2022
50f74fc
Revert to conversion_window per discussed naming conventions
dsprayberry Feb 22, 2022
d270c20
Clear currently_syncing after stream completion
dsprayberry Feb 22, 2022
c9ca6d0
Fix bug TDL-17887, whitespace clean up
dsprayberry Feb 22, 2022
cc668d2
Fix import for create_nested_resource_schema
dsprayberry Feb 22, 2022
f697857
Remove tests for deleted functions
dsprayberry Feb 22, 2022
4dca226
Update import for generate_hash
dsprayberry Feb 22, 2022
0addaa8
Add get_query_date, add unit tests for get_query_date
dsprayberry Feb 22, 2022
4a62143
Add unit tests to circle runs
dsprayberry Feb 22, 2022
20d08d1
Finish refactor - call the new function name
dsprayberry Feb 22, 2022
d48cc7f
Fix imports in unit test
dsprayberry Feb 22, 2022
3ca8a46
Fix bug in refactor: update arg name
dsprayberry Feb 22, 2022
28d07fe
Remove default value in get_bookmark
dsprayberry Feb 23, 2022
171c07d
Pass in a datetime string to get_query_date
dsprayberry Feb 23, 2022
f27ba4b
Return datetime objects from get_query_date
dsprayberry Feb 23, 2022
91f0402
Clean up TODO
dsprayberry Feb 23, 2022
6330e58
Fix unit tests
dsprayberry Feb 23, 2022
f398111
Bookmark updates, test more streams, remove lookback from start_date
bhtowles Feb 23, 2022
e6a9a20
minor cleanup bookmarks test
bhtowles Feb 23, 2022
6abc0e1
Delete campaigns.json
dsprayberry Feb 23, 2022
91d24f8
Delete schema_gen_protobuf.py
dsprayberry Feb 23, 2022
c74f840
Test Cleanup
bhtowles Feb 23, 2022
1dede97
comments
bhtowles Feb 23, 2022
5da7139
fix typo in disco test
bhtowles Feb 23, 2022
d41b277
fix typo in discovery test
bhtowles Feb 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 93 additions & 25 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,127 @@ version: 2.1
orbs:
slack: circleci/[email protected]

jobs:
build:
executors:
docker-executor:
docker:
- image: 218546966473.dkr.ecr.us-east-1.amazonaws.com/circle-ci:stitch-tap-tester

jobs:
# TODO remove if not needed
# build:
# executor: docker-executor
# steps:
# - run: echo 'CI done'
ensure_env:
executor: docker-executor
steps:
- checkout
- run:
name: 'Setup virtual env'
command: |
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox dev_env.sh
python3 -mvenv /usr/local/share/virtualenvs/tap-google-ads
source /usr/local/share/virtualenvs/tap-google-ads/bin/activate
pip install -U pip setuptools
pip install -e .[dev]
pip install 'pip==21.1.3'
pip install 'setuptools==56.0.0'
pip install .[dev]
- slack/notify-on-failure:
only_for_branches: master
- persist_to_workspace:
root: /usr/local/share/virtualenvs
paths:
- tap-google-ads
run_pylint:
executor: docker-executor
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'Run pylint'
command: |
source /usr/local/share/virtualenvs/tap-google-ads/bin/activate
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox dev_env.sh
source dev_env.sh
echo "$PYLINT_DISABLE_LIST"
pylint tap_google_ads --disable "$PYLINT_DISABLE_LIST"
- slack/notify-on-failure:
only_for_branches: master

run_unit_tests:
executor: docker-executor
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'pylint'
name: 'Run Unit Tests'
command: |
source /usr/local/share/virtualenvs/tap-google-ads/bin/activate
# TODO: Adjust the pylint disables
pylint tap_google_ads --disable 'broad-except,chained-comparison,empty-docstring,fixme,invalid-name,line-too-long,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-raise,no-else-return,too-few-public-methods,too-many-arguments,too-many-branches,too-many-lines,too-many-locals,ungrouped-imports,wrong-spelling-in-comment,wrong-spelling-in-docstring,bad-whitespace,missing-class-docstring'
# TODO implement this run block when tests are avialable!
# - run:
# name: 'Unit Tests'
# command: |
# source /usr/local/share/virtualenvs/tap-google-ads/bin/activate
# nosetests tests/unittests
pip install nose coverage
nosetests --with-coverage --cover-erase --cover-package=tap_google_ads --cover-html-dir=htmlcov tests/unittests
coverage html
- store_test_results:
path: test_output/report.xml
- store_artifacts:
path: htmlcov
- slack/notify-on-failure:
only_for_branches: master

run_integration_tests:
executor: docker-executor
parallelism: 6
steps:
- checkout
- attach_workspace:
at: /usr/local/share/virtualenvs
- run:
name: 'Integration Tests'
name: 'Run Integration Tests'
command: |
aws s3 cp s3://com-stitchdata-dev-deployment-assets/environments/tap-tester/tap_tester_sandbox dev_env.sh
source dev_env.sh
source /usr/local/share/virtualenvs/tap-tester/bin/activate
run-test --tap=tap-google-ads tests
circleci tests glob "tests/*.py" | circleci tests split > ./tests-to-run
if [ -s ./tests-to-run ]; then
for test_file in $(cat ./tests-to-run)
do
run-test --tap=${CIRCLE_PROJECT_REPONAME} $test_file
done
fi
- slack/notify-on-failure:
only_for_branches: main
only_for_branches: master

workflows:
version: 2
commit:
commit: &commit_jobs
jobs:
- build:
- ensure_env:
context:
- circleci-user
- tier-1-tap-user
- run_pylint:
context:
- circleci-user
- tap-tester-user
- tier-1-tap-user
requires:
- ensure_env
- run_unit_tests:
context:
- circleci-user
- tier-1-tap-user
requires:
- ensure_env
- run_integration_tests:
context:
- circleci-user
- tier-1-tap-user
requires:
- ensure_env
build_daily:
<<: *commit_jobs
triggers:
- schedule:
cron: "0 3 * * *"
filters:
branches:
only:
- main
jobs:
- build:
context:
- circleci-user
- tap-tester-user
159 changes: 0 additions & 159 deletions spikes/schema_gen_protobuf.py

This file was deleted.

Loading