Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
2860 commits
Select commit Hold shift + click to select a range
1e2bb80
Don't loose the user!
avdata99 Sep 29, 2022
dafab24
Update blueprint example plugin
pdelboca Sep 30, 2022
47d7dc5
clean_context
avdata99 Sep 30, 2022
85b4624
Update ckan/common.py
avdata99 Sep 30, 2022
e886a3e
update UK Open Goverment license url
TomeCirun Oct 1, 2022
d199d39
Merge pull request #7113 from salsadigitalauorg/7102-Hyperlink-with-t…
amercader Oct 4, 2022
004878f
move fresh_context to tk
avdata99 Oct 4, 2022
80e7e71
crying town
avdata99 Oct 4, 2022
168f390
Test for fresh_context
avdata99 Oct 4, 2022
6748fe0
[#7119] package_update performance purge resources approach
wardi Oct 4, 2022
0f13fd4
[#7028] lint
amercader Oct 5, 2022
0766930
Merge pull request #7108 from pdelboca/fix-plugin-blueprint-register
smotornyuk Oct 5, 2022
a973654
Remove dataset count as it resulted in unneeded package_search while …
Zharktas Oct 6, 2022
a038dae
Added changelog.
JVickery-TBS Oct 6, 2022
bc81152
Merge pull request #7039 from JVickery-TBS/fix/capped-alphabetization
wardi Oct 6, 2022
45a5e0e
Moved imports to module top level. Changed `list_orphans` to `get_orp…
JVickery-TBS Oct 6, 2022
27dd75a
Fixed syntax issues reported by flake8.
JVickery-TBS Oct 6, 2022
2448cd9
Merge pull request #7044 from JVickery-TBS/feature/search-index-remov…
smotornyuk Oct 7, 2022
ec11c17
Added the csrf_input.html in templates-bs3/snippets
Gauravp-NEC Oct 10, 2022
a1228b3
Create 7127.misc
Gauravp-NEC Oct 10, 2022
eaa1c43
update cookie_expires, cookie_domain and timeout
kowh-ai Oct 10, 2022
6f26ab4
Proofread config docs
amercader Oct 13, 2022
bfa0129
Add missing descriptions to config declarations so they come up in docs
amercader Oct 13, 2022
8194e74
Merge branch 'config-declaration-document-code'
amercader Oct 13, 2022
429fcf0
Merge pull request #7096 from ckan/7028-API-and-CSRF
wardi Oct 13, 2022
b89a925
Revert deletion of ckan.default.group_type/org_type config options
amercader Oct 13, 2022
66ec5ba
Merge branch 'master' of github.com:ckan/ckan
amercader Oct 13, 2022
36112c8
Update config_declaration.yaml to use .example.com
kowh-ai Oct 14, 2022
55b77a8
Merge pull request #7123 from ckan/remove_unneeded_package_search_fro…
tino097 Oct 15, 2022
c73669a
Create 7133.bugfix
kowh-ai Oct 17, 2022
e46e730
Don't use API keys in DataPusher
amercader Oct 18, 2022
a00b8b6
Adapt Datapusher tests to use api tokens
amercader Oct 18, 2022
70768b2
Add changelog entry
amercader Oct 18, 2022
33be34e
Merge pull request #7133 from ckan/beaker-session-parameters-in-confi…
smotornyuk Oct 18, 2022
ea4d312
Fix datapusher dependent tests
amercader Oct 18, 2022
5a2417a
Declaration for options commented by default
smotornyuk Oct 18, 2022
284f5f9
Types update: 2022-10
smotornyuk Oct 18, 2022
2959b6c
flake8
smotornyuk Oct 18, 2022
87c8be1
Bump moment from 2.29.2 to 2.29.4
dependabot[bot] Oct 19, 2022
56046f3
Update momentjs from correct places
Zharktas Oct 19, 2022
572607a
Merge pull request #7145 from ckan/dependabot/npm_and_yarn/moment-2.29.4
Zharktas Oct 20, 2022
86ccc23
Merge pull request #7141 from ckan/commented-config-declaration
amercader Oct 20, 2022
2bfbfdf
Merge pull request #7142 from ckan/typing-2022-10
amercader Oct 20, 2022
5116af3
Automatically rename deprecated IPackageController methods
smotornyuk Oct 20, 2022
653702a
Merge pull request #7127 from Gauravp-NEC/fix-for-issue-7124
pdelboca Oct 21, 2022
c251290
Merge pull request #6978 from robin-NEC/6004---show-error-when-org/gr…
pdelboca Oct 22, 2022
34bff36
[#7149] Fix organization delete form
Zharktas Oct 24, 2022
3413cc4
Added test
Zharktas Oct 24, 2022
6e27e7d
changelog entry
Zharktas Oct 24, 2022
84c7af6
flake8
Zharktas Oct 24, 2022
a108e73
Merge branch 'fix_organization_delete'
amercader Oct 25, 2022
51275c9
Duplicate warnings as logs
smotornyuk Oct 25, 2022
4a22b39
Merge pull request #7112 from avdata99/preserve_user_context
wardi Oct 25, 2022
cc1c6e4
Perform checks on provided id when creating user
amercader Oct 26, 2022
63bcd16
Update latest CHANGELOG
amercader Oct 26, 2022
2db3c56
Fix docs copyright year
avdata99 Oct 25, 2022
6324ff9
Merge pull request #7153 from avdata99/fix-year
kowh-ai Oct 28, 2022
6b18217
Merge pull request #7148 from ckan/fix-support-of-deprecated-ipackage…
pdelboca Oct 29, 2022
cb4eda5
Fix Bootstrap 3 webassets
pdelboca Oct 29, 2022
d3ea7a4
Add changelog
pdelboca Oct 29, 2022
b7c0a76
Fix license field display
pdelboca Oct 29, 2022
ea3d92c
Add changelog
pdelboca Oct 29, 2022
f38445c
Sync css files with latest updates
pdelboca Oct 29, 2022
1f3c2e3
[#7166] allow plugins to implement old and new method names
wardi Oct 31, 2022
28d6b2c
Add changelog
pdelboca Nov 1, 2022
4a43842
Merge pull request #7167 from ckan/7166-old-and-new
pdelboca Nov 1, 2022
e54f0bc
Update activity stream icons to fontawesome
pdelboca Nov 2, 2022
3a57e66
Clean obsolete new class and add pull-right
pdelboca Nov 2, 2022
fd12969
Fix background position
pdelboca Nov 2, 2022
eb3e31b
Clean obsolete class
pdelboca Nov 2, 2022
5a4dd1c
Simplify scss file
pdelboca Nov 3, 2022
49effff
Move variables. Remove obsolete followee-popover css class.
pdelboca Nov 3, 2022
ff470c2
Move activity css to extensions folder
pdelboca Nov 3, 2022
95cc57a
Add changelog
pdelboca Nov 3, 2022
cb33e18
Added a `search-index` subcommand `list-unindexed`
JVickery-TBS Nov 3, 2022
0aa260c
Added changelog file.
JVickery-TBS Nov 3, 2022
b14d586
syntax fixes from flake8.
JVickery-TBS Nov 4, 2022
c7e6b74
Changed code to re-used `only-missing` code from the `rebuild` sub-co…
JVickery-TBS Nov 4, 2022
92cb117
Add closing quote
pdelboca Nov 6, 2022
60934c4
Merge pull request #7177 from pdelboca/add-closing-quotes
amercader Nov 8, 2022
7e2ad3e
Merge pull request #7161 from pdelboca/fix-boostrap3-webassets
amercader Nov 9, 2022
e16ff34
Merge pull request #7162 from pdelboca/fix-license-input-display
amercader Nov 9, 2022
279081a
Merge pull request #7163 from pdelboca/sync-css-files
amercader Nov 9, 2022
f7ddbf6
Merge pull request #7169 from pdelboca/fix-activity-stream-icons
amercader Nov 9, 2022
707a394
Merge pull request #7139 from ckan/use-api-tokens-in-datapusher
amercader Nov 9, 2022
bd151f7
Update version for 2.10b
amercader Nov 9, 2022
97ce030
[#7119] package_update performance backport version
wardi Oct 4, 2022
6631550
[#7119] filter first, then purge
wardi Nov 14, 2022
9a13946
[#7119] changelog
wardi Nov 14, 2022
6fc526b
Update control-label to BS5 form-label
pdelboca Nov 6, 2022
0d1194f
Update from control-label to form-label
pdelboca Nov 6, 2022
adcc5b2
Fix 404 when selecting the same date in the changes view
amercader Nov 9, 2022
6e86c20
add changelog
amercader Nov 9, 2022
4401e01
Fix social icons
pdelboca Nov 11, 2022
e80a529
Fix popular icon
pdelboca Nov 12, 2022
a503ff8
Clean icons of facet-list
pdelboca Nov 12, 2022
c6b7581
Remove no longer used template
pdelboca Nov 12, 2022
0baccde
Clean old ckan-icon css class
pdelboca Nov 12, 2022
ef5b2ff
Add changelog
pdelboca Nov 12, 2022
2b44331
Cleanup tertiary CSS class
pdelboca Nov 15, 2022
8243ef7
Clean unused nav-btn css class
pdelboca Nov 15, 2022
8346e01
Add close element in facet nav
pdelboca Nov 15, 2022
4e38115
Remove copied file
pdelboca Nov 12, 2022
f237880
Fix tag list css class
pdelboca Nov 10, 2022
16b51ae
[i18n] Update strings catalog (pot)
amercader Nov 16, 2022
e05a36a
[i18n] Update po files with latest strings for 2.10
amercader Nov 16, 2022
3ae6fa9
[i18n] Compile string files
amercader Nov 16, 2022
c5e441f
[i18n] Fix errors in po files
amercader Nov 16, 2022
0943254
[i18n] Update transifex resource id
amercader Nov 16, 2022
231686c
[i18n] Compile string files
amercader Nov 16, 2022
27a64e1
[#7119] explain reasons for changes to resource handling
wardi Nov 22, 2022
4b1c77f
[#7230] Add dev containers / codespaces config for CKAN 2.10
amercader Nov 29, 2022
04b02e4
config.get -> config.get_value / extra config declarations
smotornyuk Dec 5, 2022
22bcc12
fix tests
smotornyuk Dec 5, 2022
d1ca5a7
add changelog fragment
smotornyuk Dec 5, 2022
168c10f
Final update for types: 2022-12
smotornyuk Dec 5, 2022
868d1aa
fixes
smotornyuk Dec 5, 2022
4f86ece
remove unnecesarry type-ignore
smotornyuk Dec 5, 2022
3fd7a42
Merge pull request #7259 from ckan/types-2022-12
amercader Dec 6, 2022
00f7bc2
Add details to descritpion
smotornyuk Dec 8, 2022
7c18729
Merge pull request #7270 from JVickery-TBS/feature/list-unindexed-com…
smotornyuk Dec 8, 2022
7590afa
Merge pull request #7269 from ckan/7119-package_update-perf-purge
smotornyuk Dec 8, 2022
28871a3
[#6930] Fix robots.txt can no longer be easily customised by @TomeCirum
amercader Dec 22, 2022
2e0b785
Read ckan.datasets_per_page on group read handler
ddazal Oct 6, 2022
4850504
Fix typo in search-index command
evertramos Nov 16, 2022
908b8a3
Remove log warnings about ckan.requests.timeout not being declared
amercader Nov 17, 2022
a9d51e3
Add option to output token value without extra messages
amercader Nov 17, 2022
6e5a88f
changelog
amercader Nov 17, 2022
344ef11
Restore resource-icons scss file
pdelboca Nov 17, 2022
0406ad2
[#7222] Use parsed config values in Flask config
amercader Nov 18, 2022
fb737a5
[#7222] Add is_declared mehtod to config object
amercader Dec 6, 2022
b9b581e
[#7222] Use get_value on declared config options
amercader Dec 6, 2022
608f15f
Add ckan user clean command
pdelboca Nov 26, 2022
1414c4c
Add force option to user clean command
pdelboca Nov 26, 2022
d39f529
Add typing
pdelboca Nov 26, 2022
4043747
pep8 fixes
pdelboca Nov 26, 2022
ad017ff
Add docstring to user clean command
pdelboca Nov 26, 2022
cb5df40
Refactor to clean group command
pdelboca Nov 30, 2022
c698654
Fix typing
pdelboca Nov 30, 2022
3a55d78
Add change file
pdelboca Nov 30, 2022
9b8fd94
Write better change file
pdelboca Dec 5, 2022
23e2af7
Update message
pdelboca Dec 7, 2022
9a5324e
Update test to new output
pdelboca Dec 7, 2022
4d894d6
Add entity type to package get_index
Zharktas Dec 2, 2022
629c844
Fix package_update documentation
Zharktas Dec 13, 2022
83c7fe4
Fix imageview icon
pdekraker-epa Dec 16, 2022
7a5762a
Update reference to Bootstrap version in docs
pdelboca Dec 22, 2022
856f5d2
Fix config option call
pdelboca Dec 2, 2022
5aa8c04
Deprecate parameter limit
pdelboca Dec 2, 2022
cbb3e3e
Add side_effect_free to actions
pdelboca Dec 16, 2022
5bfbbc9
Update language
pdelboca Dec 16, 2022
d0376ed
Merge branch 'dev-v2.10' into missing-declarations-for-default-types
amercader Dec 22, 2022
c4b2adf
Merge branch 'missing-declarations-for-default-types' into dev-v2.10
amercader Dec 22, 2022
ac12b62
Fix wrong merge
amercader Jan 9, 2023
3e127d6
Add config values to test
pdelboca Jan 11, 2023
c88b7bd
Merge pull request #7322 from pdelboca/patch-config-test-2.10
amercader Jan 12, 2023
9859ab9
build: revert find.include in setup.cfg, fix bundling via MANIFEST.in
spwoodcock Jan 12, 2023
2923dbc
fix: add config/*.yaml to MANIFEST to bundle in pip package
spwoodcock Dec 16, 2022
7e68da0
Fix color contrast of btn-danger CSS to comply with WCAG 2 AA
shashigharti Jan 13, 2023
efd93a7
Add details about JWT secrets to docs
smotornyuk Jan 13, 2023
37eff2b
get_value -> get
smotornyuk Jan 17, 2023
be7f532
Merge pull request #7330 from ckan/api-token-secret-extra-doc-2.10
amercader Jan 18, 2023
c5d9dc0
fix types and codestyle
smotornyuk Jan 18, 2023
2bee6b6
fix indent
smotornyuk Jan 20, 2023
9c82375
Merge pull request #7339 from ckan/config-declaration-remove-get_valu…
amercader Jan 20, 2023
2afa448
[#7110] Enable DateTime to be returned through Actions by @EricSoroos
amercader Jan 23, 2023
80cc34a
add resource_view resource_id index
FuhuXia Oct 11, 2022
ab990f1
Add changelog
FuhuXia Oct 11, 2022
df32e19
Make heading semantic for bug report template
shashigharti Dec 28, 2022
29590ae
Added change log fragment
shashigharti Dec 31, 2022
90598ef
Adds title in iframe
shashigharti Dec 28, 2022
58369da
Update title of iframe in embed code
shashigharti Dec 28, 2022
ee5818a
Added changelog fragment
shashigharti Dec 31, 2022
7d28207
Fixed color contrast issue in add new dataset page
shashigharti Dec 29, 2022
d02bf66
Add to changelog
shashigharti Dec 31, 2022
3b171f1
Fix api_token_list parameter
amercader Jan 19, 2023
3afb8d5
Add changelog
amercader Jan 19, 2023
5c14a1e
Clean bs3 css migrated to ckanext-activity.
pdelboca Jan 20, 2023
6f2ebf6
Attach the actual config object to Click context
amercader Jan 12, 2023
727af46
Make skip to main content visible for keyboard-only users (#7299)
shashigharti Jan 24, 2023
df4cb01
Merge branch 'dev-v2.10' of github.com:ckan/ckan into dev-v2.10
amercader Jan 24, 2023
65ceb03
Logic for legacy_key
smotornyuk Jan 24, 2023
599e837
Tests for legacy_key
smotornyuk Jan 24, 2023
010803b
Mark ckan.route_after_login as a legacy option
smotornyuk Jan 24, 2023
bb84fdf
Documentation for legacy_key
smotornyuk Jan 24, 2023
cb7992b
Fix tests
smotornyuk Jan 24, 2023
4785438
Doc tweaks
amercader Jan 24, 2023
c555a97
Fix datapusher upload log icons and css (#7279)
shashigharti Jan 24, 2023
1fd991e
Update DataTables plugin file to avoid JS error (#7362)
amercader Jan 26, 2023
43e80e5
Provide a fallback value for WTF_CSRF_SECRET_KEY
amercader Jan 26, 2023
dc507c8
Remove requirement-setuptools, and all references
EricSoroos Jan 24, 2023
15c67dd
Added changelog entry
EricSoroos Jan 24, 2023
d93514a
Touch up ci for requirement-setuptools.txt removal
EricSoroos Jan 24, 2023
920ea4c
Merge pull request #7311 from shashigharti/7193-fix-color-contrast-ac…
tino097 Jan 27, 2023
79136b4
Fixes a two errors when dealing with a encoded url.
EricSoroos Sep 30, 2021
f4ae9a7
Fix urlparse function call
EricSoroos Jun 21, 2022
0ec43d6
Lint
EricSoroos Sep 27, 2022
def7910
changelog entry
EricSoroos Dec 8, 2022
8d5300d
[#5888] use normal keys for package_revise errors
wardi Sep 21, 2022
8324dc6
[#5888] changes
wardi Sep 21, 2022
ecfaa2f
Describe how to add models to existing metadata
smotornyuk Jan 24, 2023
2c34886
Note for v2.10
smotornyuk Jan 24, 2023
af676c2
Add BaseModel to toolkit
smotornyuk Jan 26, 2023
d81d3e9
Fix broken formatting for first item in the toolkit docs
smotornyuk Jan 26, 2023
99ac15b
Add changelog entry
smotornyuk Jan 26, 2023
5ef2eee
Doc tweaks
amercader Jan 31, 2023
6e53b60
Fix names of organization and sysadmin factory fixtures
smotornyuk Feb 6, 2023
b9f0eea
Add meta csrf_field_name logic to templates and js
pdelboca Jan 30, 2023
b6c5045
Fix bs3 csrf_field_name meta tag
pdelboca Jan 30, 2023
daa4cc6
Add tests for CSRF logic
pdelboca Jan 30, 2023
ba07193
Fix CSRF test syntax
pdelboca Jan 30, 2023
e1c82e6
Separate requirements install instruction
pdelboca Nov 15, 2022
30e1f24
Update install instructions
pdelboca Nov 17, 2022
d5ed661
Update solr section
pdelboca Nov 17, 2022
6e92c3b
Fix sentence
pdelboca Nov 17, 2022
b036014
Update versions in install docs
amercader Feb 7, 2023
d82c535
Remove outdated doc pages
amercader Feb 7, 2023
89d9dcb
Remove docker under contrib/ and the CKAN Dockerfile
kowh-ai Feb 1, 2023
a36f596
Create change file 7370.removal
kowh-ai Feb 1, 2023
c720d9f
Tweak changelog entry
amercader Feb 7, 2023
25f6fe2
[#7383] Add type to WTF_CSRF_TIME_LIMIT
smotornyuk Feb 9, 2023
a6d4f59
[#7383] Add type to WTF_CSRF_TIME_LIMIT
smotornyuk Feb 9, 2023
58ef21d
Update Solr manual install docs
amercader Feb 9, 2023
dcce2e0
Update package install docs
amercader Feb 13, 2023
4923541
Update default value for ckan.storage_path to match docs
amercader Feb 13, 2023
056a346
Update install-from-docker-compose.rst
kowh-ai Dec 15, 2022
4210b61
Another update to install-from-docker-compose.rst
kowh-ai Jan 11, 2023
50275e2
Update numbering
kowh-ai Jan 12, 2023
9d4823b
Update index.rst
kowh-ai Feb 1, 2023
e7006c6
Update doc/maintaining/installing/index.rst
kowh-ai Feb 6, 2023
b753619
Update doc/maintaining/installing/install-from-docker-compose.rst
kowh-ai Feb 6, 2023
49a4219
Complete re-haul to just link to repo docs
kowh-ai Feb 8, 2023
253683b
Another update
kowh-ai Feb 9, 2023
cfc37f2
Update install-from-docker-compose.rst
kowh-ai Feb 13, 2023
aac7251
Docker compose docs tweaks
amercader Feb 14, 2023
66fb848
Remove unnecessary orphan directive
amercader Feb 14, 2023
0372cef
Improve install index page
amercader Feb 14, 2023
9e2616d
Update package.json
amercader Feb 14, 2023
84da33a
Add CSRF docs to extension best practices
amercader Feb 14, 2023
bf441e5
Update changelog for 2.10.0
amercader Feb 14, 2023
8f69ed1
Update .tx/config file format
amercader Feb 14, 2023
17bbfb5
[i18n] Pull po files from Transifex before 2.10.0
amercader Feb 14, 2023
cdc99da
[i18n] Compile mo files
amercader Feb 14, 2023
e4457b3
Merge pull request #7385 from ckan/7383-incorrect-type-of-CSRF_TIME_L…
amercader Feb 14, 2023
7c2a73b
Add more stuff to the changelog, including flask-login changes
amercader Feb 14, 2023
995338c
Merge branch 'dev-v2.10' of github.com:ckan/ckan into dev-v2.10
amercader Feb 14, 2023
3657bd8
Changelog tweaks
amercader Feb 14, 2023
70bec66
Update version for 2.10.0
amercader Feb 15, 2023
838b97e
new: pull license_list fix from upstream
nickumia-reisys May 22, 2023
48f03eb
test: see if this log is an issue
nickumia-reisys Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
63 changes: 13 additions & 50 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ version: 2
defaults:
init_environemnt: &init_environment
run: |
# SOLR config
cp ~/project/ckan/config/solr/schema.xml /etc/solr/conf/schema.xml
service jetty9 restart || true # erroring out but does seem to work

# Database Creation
psql --host=ckan-postgres --username=ckan --command="CREATE USER ${CKAN_POSTGRES_USER} WITH PASSWORD '${CKAN_POSTGRES_PWD}' NOSUPERUSER NOCREATEDB NOCREATEROLE;"
createdb --encoding=utf-8 --host=ckan-postgres --username=ckan --owner=${CKAN_POSTGRES_USER} ${CKAN_POSTGRES_DB}
Expand All @@ -15,53 +11,20 @@ defaults:

# Database Initialization
ckan -c test-core-circle-ci.ini datastore set-permissions | psql --host=ckan-postgres --username=ckan
psql --host=ckan-postgres --username=ckan --dbname=${CKAN_DATASTORE_POSTGRES_DB} --command="CREATE extension tablefunc;"
ckan -c test-core-circle-ci.ini db init
gunzip .test_durations.gz
install_deps: &install_deps
run: |
# OS Dependencies
apt update
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER)
curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt install -y nodejs
apt install -y libgtk2.0-0 libgtk-3-0 libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
npm install
;;
esac
apt install -y postgresql-client solr-jetty openjdk-8-jdk
apt install -y postgresql-client
run_tests: &run_tests
# Tests Backend, split across containers by segments
run: |
mkdir -p ~/junit
case $CIRCLE_NODE_INDEX in
0) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 1
;;
1) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 2
;;
2) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 3
;;
3) python -m pytest $PYTEST_COMMON_OPTIONS --test-group 4
;;
esac
mkdir -p ~/junit/result
python -m pytest ${PYTEST_COMMON_OPTIONS} --splits 4 --group $((CIRCLE_NODE_INDEX+1)) --splitting-algorithm least_duration

# Tests Frontend, only in one container
start_test_server: &start_test_server
run:
command: |
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER) ckan -c test-core-circle-ci.ini run
;;
esac
background: true
run_front_tests: &run_front_tests
run:
command: |
case $CIRCLE_NODE_INDEX in
$NODE_TESTS_CONTAINER)
sleep 5
$(npm bin)/cypress run
;;
esac
ckan_env: &ckan_env
environment:
CKAN_DATASTORE_POSTGRES_DB: datastore_test
Expand All @@ -73,8 +36,7 @@ defaults:
CKAN_POSTGRES_USER: ckan_default
CKAN_POSTGRES_PWD: pass
PGPASSWORD: ckan
NODE_TESTS_CONTAINER: 3
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-circle-ci.ini --cov=ckan --cov=ckanext --junitxml=/root/junit/junit.xml --test-group-count 4 --test-group-random-seed 1
PYTEST_COMMON_OPTIONS: -v --ckan-ini=test-core-circle-ci.ini --cov=ckan --cov=ckanext --junitxml=~/junit/result/junit.xml
pg_image: &pg_image
image: postgres:10
environment:
Expand All @@ -85,13 +47,19 @@ defaults:
redis_image: &redis_image
image: redis:3
name: ckan-redis

solr_image: &solr_image
image: ckan/ckan-solr:master
name: ckan-solr

jobs:
test-python-3:
docker:
- image: python:3-stretch
- image: python:3.7-bullseye
<<: *ckan_env
- <<: *pg_image
- <<: *redis_image
- <<: *solr_image

parallelism: 4

Expand All @@ -101,7 +69,6 @@ jobs:
- <<: *install_deps
- run: |
# Python Dependencies
pip install -r requirement-setuptools.txt
pip install -r requirements.txt
pip install -r dev-requirements.txt
python setup.py develop
Expand All @@ -112,10 +79,6 @@ jobs:
- <<: *run_tests
- store_test_results:
path: ~/junit
- <<: *start_test_server
- <<: *run_front_tests
- store_artifacts:
path: ~/project/cypress/screenshots
- run: coveralls
workflows:
version: 2
Expand Down
23 changes: 23 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# [Choice] Python version: 3, 3.8, 3.7, 3.6
ARG VARIANT=3
FROM mcr.microsoft.com/vscode/devcontainers/python:${VARIANT}

ENV PYTHONUNBUFFERED 1

# Update args in docker-compose.yaml to set the UID/GID of the "vscode" user.
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then groupmod --gid $USER_GID vscode && usermod --uid $USER_UID --gid $USER_GID vscode; fi

# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
ARG NODE_VERSION="none"
RUN if [ "${NODE_VERSION}" != "none" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi

# [Optional] If your requirements rarely change, uncomment this section to add them to the image.
# COPY requirements.txt /tmp/pip-tmp/
# RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \
# && rm -rf /tmp/pip-tmp

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
postgresql-client
83 changes: 83 additions & 0 deletions .devcontainer/README_codespaces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# CKAN in GitHub Codespaces

Welcome to your cloud development instance of CKAN!

⌛ If you are not seeing a browser tab with the CKAN homepage to the right or a terminal below that says _"Running CKAN on http://localhost:5000"_, wait a bit, things are getting set up... ⌛

Once you see them, you are ready to go! 🚀

## What is this?

This is an online development environment powered by [GitHub Codespaces](https://github.com/features/codespaces). It is a fully functional CKAN instance that you can configure and customize in any way you need. Changes that you make to the source files with the editor as well as changes to the site itself (e.g. creating a dataset or uploading a file) will be persisted until you delete the codespace.

⚠️ **Note:** GitHub Codespaces have a free tier, currently 120 core-hours (i.e. 60h on the default 2-core VM, 30h on a 4-core VM), but after that you will be charged for usage. Check the [documentation](https://github.com/features/codespaces) for more details. To check your current usage, go to the [Billing page](https://github.com/settings/billing) in your profile. ⚠️


## What can I do with it?

### Explore

It's your own CKAN demo site! You can log in using the `ckan_admin` sysadmin user (password `test1234`) which will give you full control of the UI. Try creating an Organization, adding some datasets, uploading data, etc

* [User Guide](https://docs.ckan.org/en/latest/user-guide.html)
* [Sysadmin Guide](https://docs.ckan.org/en/latest/sysadmin-guide.html)


### Customize

The site has been configured using the default settings that you get in a brand new CKAN instance but you can change any configuration in the `ckan.ini` file. The development server will refresh automatically as soon as you save your changes to reflect the new configuration.

* [Configuration options reference](https://docs.ckan.org/en/latest/maintaining/configuration.html#ckan-configuration-file)
* [Authorization overview](https://docs.ckan.org/en/latest/maintaining/authorization.html)

Additionally, you can install as many extensions as you want. Check the extension README for any particular instructions but they all basically follow the same pattern:
1. Open a new terminal in the panel below
2. Clone the extension
```
git clone https://github.com/ckan/ckanext-dcat.git
```
3. Install the extension
```
cd ckanext-dcat
python setup.py develop --user
```
3. Install extra requirements (if any)
```
pip install -r requirements.txt
```
4. Add the plugin(s) to the `ckan.plugins` configuration option in the `ckan.ini` file.

### Develop

What you are using right now is an online editor, Visual Studio Code for the Web, which runs in your browser. You can browse the files in the CKAN source code using the tree panel on the left, open one of them and edit it. Once you save your changes, the development server will be restarted automatically.

You can commit your changes to the branch where you started the codespace in using the "Source Control" icon in the left toolbar.

* [Getting started with Visual Studio Code](https://code.visualstudio.com/docs/editor/codebasics)
* [CKAN Architecture Overview](https://docs.ckan.org/en/latest/contributing/architecture.html)

#### Database

You can run queries against the PostgreSQL database using the "SQLTools" plugin, the database icon in the left toolbar.

* [SQLTools documentation](https://vscode-sqltools.mteixeira.dev/en/home/#features)

#### Tests

To run the automated tests simply add a new terminal to the console below and run the `pytest` command:

```
pytest --ckan-ini=test-core.ini ckan ckanext
```

Or to run a specific test:

```
pytest --ckan-ini=test-core.ini ckan/tests/logic/action/test_create.py::TestMemberCreate::test_group_member_creation
```

## I need more!

* If you are finding the codespace too slow you can change the machine type to add more cores to the VM, but note that this will count towards your free allowed quota.
* If you don't like the editor, you can run the same codespace using your local [Visual Studio Code](https://docs.github.com/en/codespaces/developing-in-codespaces/using-github-codespaces-in-visual-studio-code) or [JetBrains IDE](https://docs.github.com/en/codespaces/developing-in-codespaces/using-github-codespaces-in-your-jetbrains-ide) instances.
* Alternatively you can use a [Docker Compose setup](https://github.com/ckan/ckan-docker) or do a tried and tested [Source Install](https://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html) in your local computer.
70 changes: 70 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// Update the VARIANT arg in docker-compose.yml to pick a Python version: 3, 3.8, 3.7, 3.6
{
"name": "CKAN 2.10",
"dockerComposeFile": "docker-compose.yml",
"service": "ckan",
"workspaceFolder": "/workspace",

// Set *default* container specific settings.json values on container create.
"settings": {
"sqltools.connections": [{
"name": "CKAN PostgreSQL DB",
"driver": "PostgreSQL",
"previewLimit": 50,
"server": "localhost",
"port": 5432,
"database": "ckan_default",
"username": "ckan_default",
"password": "pass"
}],
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
"python.testing.pytestPath": "/usr/local/py-utils/bin/pytest"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"mtxr.sqltools",
"mtxr.sqltools-driver-pg"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5000, 5432, 8983, 6379, 8800],

// Open in browser
"portsAttributes": {
"5000": {
"label": "CKAN",
"onAutoForward": "openPreview"
}
},

// Use 'postCreateCommand' to run commands after the container is created.
"onCreateCommand": "pip install --user -r requirements.txt && pip install --user -r dev-requirements.txt",
"postCreateCommand": "./.devcontainer/setup.sh",
"postAttachCommand": "ckan run",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

"customizations": {
"codespaces": {
"openFiles": [
".devcontainer/README_codespaces.md"
]
}
}
}
64 changes: 64 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: '3'

services:
ckan:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
# [Choice] Python version: 3, 3.8, 3.7, 3.6
VARIANT: 3.9
# [Choice] Node.js version: none, lts/*, 16, 14, 12, 10
NODE_VERSION: "lts/*"
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
USER_UID: 1000
USER_GID: 1000

volumes:
- ..:/workspace:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

db:
image: postgres:14
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres-docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
POSTGRES_USER: ckan_default
POSTGRES_DB: ckan_default
POSTGRES_PASSWORD: pass
network_mode: service:ckan
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)

solr:
container_name: solr
image: ckan/ckan-solr:2.9-solr8
network_mode: service:ckan
volumes:
- solr-data:/var/solr

redis:
network_mode: service:ckan
container_name: redis
image: redis:alpine

datapusher:
container_name: datapusher
network_mode: service:ckan
image: ckan/ckan-base-datapusher:0.0.19

volumes:
postgres-data:
solr-data:
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CREATE ROLE datastore_default NOSUPERUSER NOCREATEDB NOCREATEROLE LOGIN PASSWORD 'pass';
CREATE DATABASE datastore_default OWNER ckan_default ENCODING 'utf-8';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CREATE DATABASE ckan_test OWNER ckan_default ENCODING 'utf-8';
29 changes: 29 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Install CKAN locally
python setup.py develop --user

# Create ini file
ckan generate config ckan.ini

# Set up storage
mkdir /workspace/data
ckan config-tool ckan.ini ckan.storage_path=/workspace/data

# Set up site URL
ckan config-tool ckan.ini ckan.site_url=https://$CODESPACE_NAME-5000.$GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN

# Init DB
ckan db init

# Create sysadmin user
ckan user add ckan_admin email=admin@example.com password=test1234
ckan sysadmin add ckan_admin

# Set up DataStore + DataPusher
ckan config-tool ckan.ini "ckan.datapusher.api_token=$(ckan user token add ckan_admin datapusher | tail -n 1 | tr -d '\t')"
ckan config-tool ckan.ini \
ckan.datastore.write_url=postgresql://ckan_default:pass@localhost/datastore_default \
ckan.datastore.read_url=postgresql://datastore_default:pass@localhost/datastore_default \
ckan.datapusher.url=http://localhost:8800 \
ckan.datapusher.callback_url_base=http://localhost:5000 \
"ckan.plugins=activity datastore datapusher datatables_view"
ckan datastore set-permissions | psql $(grep ckan.datastore.write_url ckan.ini | awk -F= '{print $2}')
Loading