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

Dev #35

Merged
merged 343 commits into from
Jan 21, 2024
Merged

Dev #35

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
343 commits
Select commit Hold shift + click to select a range
f7c99b8
Merge remote-tracking branch 'origin/master' into api-v3
EliezerIsrael Oct 31, 2023
73e4a2d
fix: Performance improvement of Ref.contains
EliezerIsrael Oct 31, 2023
42d0bfa
fix: Add test for Ref.contains
EliezerIsrael Oct 31, 2023
744aad2
Merge pull request #1684 from Sefaria/text-v3-contains-perf-patch
EliezerIsrael Oct 31, 2023
9223f0a
Change team member components to use InterfaceText and reformat to ma…
relyks Oct 31, 2023
d5c5dfb
Remove unnecessary files
relyks Oct 31, 2023
1b35068
feat(strapi-cms): Rewrite Jobs page to use StaticPages component and …
relyks Nov 1, 2023
08ceea5
Fix small bug: change class to className
relyks Nov 1, 2023
3e92cfc
feat(jobs): Sort team members in the correct order when the interface…
relyks Nov 1, 2023
e5f8a3d
chore(tests): remain tests db after done.
YishaiGlasner Nov 5, 2023
261f5b7
merge
YishaiGlasner Nov 9, 2023
ff8b266
feat(api): get texts from new api.
YishaiGlasner Nov 9, 2023
b034fee
Merge remote-tracking branch 'origin/master' into failing-tests
edamboritz Nov 9, 2023
da7f921
ci: Temporarily disable sandbox uninstall
edamboritz Nov 9, 2023
88abb8f
refactor(VersionBlock): Extract new component OpenVersion from Versio…
YishaiGlasner Nov 12, 2023
6027f64
refactor(VersionBlock): change string to text.
YishaiGlasner Nov 12, 2023
dd79d4a
chore: added 'picture' to AdminEditor
stevekaplan123 Nov 12, 2023
622e30e
fix(VersionBlock): remove isRequired from openVersionInReader.
YishaiGlasner Nov 12, 2023
c0562dc
Merge branch 'master' into feature/sc-21570/staff-who-edit-topic-page…
stevekaplan123 Nov 14, 2023
bf28e49
test(api): tests for one base, source and translation.
YishaiGlasner Nov 15, 2023
7b4bd2e
doc(api): correct doc string for direction attribute of Version.
YishaiGlasner Nov 15, 2023
1801a0d
feat(api): add direction attr to version when saved.
YishaiGlasner Nov 15, 2023
f7936f8
feat(api): add return_format param that can be default, text_only (fo…
YishaiGlasner Nov 16, 2023
12bb05c
test(api): test return_format.
YishaiGlasner Nov 16, 2023
1232196
refactor(api): remove unnecessary nonlocal params.
YishaiGlasner Nov 16, 2023
1d51f60
refactor(api): better order of functions.
YishaiGlasner Nov 16, 2023
f4b57c8
fix(api): avoid accumulation of functions in iteration.
YishaiGlasner Nov 16, 2023
492f16f
refactor(api): move creation of function before its unlocal params.
YishaiGlasner Nov 16, 2023
b061e8b
refactor(api): remove redundant import.
YishaiGlasner Nov 16, 2023
3ea41f4
refactor(api): calculate language without function.
YishaiGlasner Nov 16, 2023
6efe4f1
Replace placeholders code with CSS to eliminate the need for calculat…
relyks Nov 19, 2023
fd6e824
Move components and functions related to TeamMembersPage inside the c…
relyks Nov 19, 2023
2cc9808
feat(jobs): Allow job postings to have a start date and end date for …
relyks Nov 19, 2023
b6ab322
Move components to be within the JobsPage component and rename compon…
relyks Nov 19, 2023
3315a20
Merge branch 'master' into api-v3
YishaiGlasner Nov 20, 2023
65787d1
chore: starting backend for image uploader
stevekaplan123 Nov 20, 2023
750e965
Merge branch 'master' into feature/sc-21570/staff-who-edit-topic-page…
stevekaplan123 Nov 20, 2023
1596f18
feat(api-v3): add new attribute 'fullLanguage' to Version, and use it…
YishaiGlasner Nov 20, 2023
8115d1f
feat(api-v3): return error when return_format is not one of our known…
YishaiGlasner Nov 20, 2023
778cf49
chore: start topic_upload_photo
stevekaplan123 Nov 21, 2023
81f56be
Merge branch 'api-v3' into translations
YishaiGlasner Nov 21, 2023
1b3c3b7
Merge branch 'chore/sc-20618/add-topics-image-and-metadata-to-topics-…
stevekaplan123 Nov 21, 2023
80f1a8c
feat(Topic Editor): Topic Editor can post to google cloud and return…
stevekaplan123 Nov 21, 2023
9c2829e
refactor(translations): new js class in VersionBlock.jsx for versions…
YishaiGlasner Nov 21, 2023
1dd9c8c
refactor(translations): new component VersionDetailsInformation extra…
YishaiGlasner Nov 21, 2023
5678f8f
refactor(translation): new component VersionDetailsImage extracted fr…
YishaiGlasner Nov 22, 2023
b8ada14
refactor(translations): move makeVersionTitle to versionTools.
YishaiGlasner Nov 22, 2023
1f53377
refactor(translations): add option for different text in OpenConnecti…
YishaiGlasner Nov 22, 2023
1bf6cf8
feat(Topic Editor): can add pictures with captions
stevekaplan123 Nov 22, 2023
ab98485
fix(Topic Editor): when uploading topic photo, delete old one
stevekaplan123 Nov 22, 2023
939d7de
feat(translations): functions for getting texts and particularly tran…
YishaiGlasner Nov 22, 2023
c82d711
refactor(text api): change fullLanguage to languageFamilyName.
YishaiGlasner Nov 22, 2023
336e758
feat(text api): return the language attribute to api response.
YishaiGlasner Nov 22, 2023
18dad10
feat(text api): find language also with capital letters.
YishaiGlasner Nov 22, 2023
db17da1
refactor(text api): replace base by primary.
YishaiGlasner Nov 22, 2023
88a35ac
Merge branch 'api-v3' into translations
YishaiGlasner Nov 22, 2023
735ef33
Merge branch 'master' into feature/sc-21570/staff-who-edit-topic-page…
stevekaplan123 Nov 23, 2023
fca5463
feat(translations): show translations with preview.
YishaiGlasner Nov 23, 2023
f8194f9
fix: change_parent needs to force update of node full_title
stevekaplan123 Nov 23, 2023
0a41efa
chore: allow for exact_match
stevekaplan123 Nov 23, 2023
15bdf96
chore: move picture and captions
stevekaplan123 Nov 23, 2023
8e57dc3
chore: undo mistake to get_bucket
stevekaplan123 Nov 23, 2023
965c4ee
feat(translations): styles for new feature.
YishaiGlasner Nov 23, 2023
b2375ba
fix(translations): version title in Hebrew when interface is Hebrew a…
YishaiGlasner Nov 23, 2023
2e5e4e6
feat(translations): ass Hebrew strings for Select and Currently Selec…
YishaiGlasner Nov 23, 2023
4e5c804
fix(translations): change right-margin to margin-inline-end for worki…
YishaiGlasner Nov 23, 2023
a4bfd2f
feat(translations): update TranslationBox when moving segments.
YishaiGlasner Nov 23, 2023
203a744
chore: ignore_cascade
stevekaplan123 Nov 23, 2023
562de7b
feat(translations): rtl for rel translations.
YishaiGlasner Nov 23, 2023
04556c9
Merge branch 'master' into feature/sc-21570/staff-who-edit-topic-page…
stevekaplan123 Nov 24, 2023
6237432
fix(translations): click chevron to close.
YishaiGlasner Nov 26, 2023
565c00a
refactor(translations): remove superfluous css rules.
YishaiGlasner Nov 26, 2023
b196240
refactor(translations): replace logic of 'if component else null' by …
YishaiGlasner Nov 26, 2023
9918da9
chore: undo unnecessary change to ProfilePic
stevekaplan123 Nov 26, 2023
07d4605
fix(Topic Editor): resize images as thumbnails 300x300
stevekaplan123 Nov 26, 2023
8604512
feat(translations): truncate translation with expanding ellipsis.
YishaiGlasner Nov 26, 2023
437c066
chore: add validation for aspect ratio
stevekaplan123 Nov 26, 2023
be94119
feat(translations): chevron svg files.
YishaiGlasner Nov 26, 2023
59fa18f
refactor(translations): use contentText rather than specific rules.
YishaiGlasner Nov 27, 2023
48e5d4e
Merge branch 'master' into helperbugs
stevekaplan123 Nov 27, 2023
445e642
chore: DELETE image with topic editor started
stevekaplan123 Nov 27, 2023
1a09b2f
fix(translations): all elements of VersionBlockWithPreviewWTitleLine …
YishaiGlasner Nov 27, 2023
ea2cf71
refactoe(translations): chevron image in css rather than jsx.
YishaiGlasner Nov 27, 2023
b7af636
feat(Topic Editor): remove image button
stevekaplan123 Nov 28, 2023
6776661
Merge remote-tracking branch 'origin/master' into failing-tests
edamboritz Nov 28, 2023
f6f3dba
fix(translations): fix font for versionPreviewWithOptionalEllipsis.
YishaiGlasner Nov 28, 2023
f5bab30
fix(translations): fix everything for elements that should have curso…
YishaiGlasner Nov 28, 2023
3dbaa1a
fix(translations): typo.
YishaiGlasner Nov 28, 2023
f74f953
fix(translations): default cursor for 'currently selected'.
YishaiGlasner Nov 28, 2023
3e3a9f2
Merge pull request #1655 from Sefaria/mongo-connection-error-missing-db
edamboritz Nov 29, 2023
74e0dfb
refactor(translations): typo.
YishaiGlasner Nov 29, 2023
a2d7305
fix(Admin Editor): Add places that are neighborhoods or villages
stevekaplan123 Nov 29, 2023
0b43a86
feat(translations): border line only after language.
YishaiGlasner Nov 29, 2023
2d081db
feat(translations): space between version title and image.
YishaiGlasner Nov 29, 2023
51f6c8b
fix(translations): replace margin and outline by padding.
YishaiGlasner Nov 29, 2023
ed77c69
fix(translations): make ReaderPanel.selectVersion work on mobile.
YishaiGlasner Nov 29, 2023
95923ce
chore: fix CSS of Upload picture button
stevekaplan123 Nov 29, 2023
6d8152d
chore: revert get_bucket
stevekaplan123 Nov 30, 2023
e8b35c3
test: Temporarily disable crm tests that were never properly written
edamboritz Nov 30, 2023
f07d43f
fix: Try to connect to mongo replica set using primaryPreferred read …
edamboritz Nov 30, 2023
e14b966
ci: rework pytest launcher to read running spec and prevent drift
BrendanGalloway Dec 1, 2023
8b2abce
Merge pull request #1733 from Sefaria/failing-tests-fix-pytest
edamboritz Dec 3, 2023
b38a922
fix(Topic Editor): dont allow "Cancel" (only allow "Save") if removed…
stevekaplan123 Dec 3, 2023
2386a9f
ci: Fix for error parsing job manifest file
edamboritz Dec 3, 2023
463ff17
ci: Fix for error parsing job manifest file #2
edamboritz Dec 3, 2023
a7f390c
ci: Try to add restartPolicy to the pytest job's spec.
edamboritz Dec 3, 2023
61b7807
Reorganize code to be within different scope and add some documentation
relyks Dec 4, 2023
1fd2c2d
Merge branch 'master' into helperbugs
stevekaplan123 Dec 4, 2023
4ff856f
Reorganize code and move grouping of the jobs by department to where …
relyks Dec 4, 2023
4ac841b
chore: remove unnecessary imports
stevekaplan123 Dec 4, 2023
c8bc433
fix: yq format
BrendanGalloway Dec 4, 2023
aacee58
Merge pull request #1736 from Sefaria/failing-tests-fix-pytest
edamboritz Dec 4, 2023
0c17b44
fix: remove healthchecks from job pod
BrendanGalloway Dec 4, 2023
00d6e76
Merge pull request #1737 from Sefaria/failing-tests-fix-pytest
edamboritz Dec 4, 2023
78dc355
fix(translations): rerender on any change (including resize) for gett…
YishaiGlasner Dec 4, 2023
baee75f
feat(translations): no underline when hovering the content of transla…
YishaiGlasner Dec 4, 2023
438e7c5
refactor(translations): use html details and summary rather than reac…
YishaiGlasner Dec 4, 2023
08d7863
feat(translations): vertical space between blocks of 30px.
YishaiGlasner Dec 4, 2023
bcc65a7
Merge pull request #1644 from Sefaria/elasticsearch-8-compat
nsantacruz Dec 5, 2023
4b042fd
helm(search): fix typo
nsantacruz Dec 5, 2023
f5cb99a
Merge pull request #1738 from Sefaria/es-8-cronjob-typo
nsantacruz Dec 5, 2023
38dc6c2
chore: switch 200 to 150 caption maximum
stevekaplan123 Dec 5, 2023
75fda5c
helm(search): fix typo
nsantacruz Dec 5, 2023
9e85e29
Merge pull request #1739 from Sefaria/es-8-cronjob-typo2
nsantacruz Dec 5, 2023
d6883e0
Merge branch 'master' into helperbugs
stevekaplan123 Dec 5, 2023
0df8aaa
test: Remove expected failure on `test_check_first()`
edamboritz Dec 5, 2023
59bf1dd
test: Refactor tests for mismatched actualLanguage saving
edamboritz Dec 5, 2023
478ea6d
Revert "ci: Temporarily disable sandbox uninstall"
edamboritz Dec 5, 2023
db696df
Merge branch 'master' into api-v3
YishaiGlasner Dec 5, 2023
4ce5c82
Merge branch 'api-v3' into translations
YishaiGlasner Dec 5, 2023
e0357cf
Merge remote-tracking branch 'origin/master' into failing-tests
edamboritz Dec 5, 2023
db1c693
ci: Remove old and now deprecated pyTestPod.yaml
edamboritz Dec 5, 2023
98b802d
Revert "chore(tests): remain tests db after done."
edamboritz Dec 5, 2023
4cddbaa
helm(feat): Add cronjob for Trend calculation
edamboritz Dec 5, 2023
eda8bbc
chore: Rename directory and script name to conform to the rest of the…
edamboritz Dec 5, 2023
b445951
chore: move all cronjob related scripts to their own directory
edamboritz Dec 5, 2023
93fea2a
fix: Actually enable new cronjob on prod
edamboritz Dec 5, 2023
438ee61
Merge master and resolve conflicts
relyks Dec 5, 2023
199b84a
Merge branch 'master' into feature/sc-21364/use-strapi-for-jobs-page
relyks Dec 6, 2023
faa2970
Merge pull request #1695 from Sefaria/failing-tests
edamboritz Dec 6, 2023
92e7a43
Merge remote-tracking branch 'origin/master' into chore/sc-22581/rema…
edamboritz Dec 6, 2023
cc789a2
Merge pull request #1740 from Sefaria/chore/sc-22581/remake-trends-cr…
edamboritz Dec 6, 2023
12655be
Merge remote-tracking branch 'origin/master' into feature/sc-21364/us…
edamboritz Dec 6, 2023
d9af316
Merge remote-tracking branch 'origin/master' into feature/sc-20517/us…
edamboritz Dec 6, 2023
ae56347
Merge branch 'master' into chore/sc-22401/not-able-to-add-certain-pla…
stevekaplan123 Dec 6, 2023
f386c21
Reorganize functions into proper scope
relyks Dec 6, 2023
d37b5a1
Reorganize functions into proper scope
relyks Dec 6, 2023
cae792b
fix(Topic Editor): save topic upon upload/remove image
stevekaplan123 Dec 7, 2023
59b964e
Merge pull request #1680 from Sefaria/feature/sc-20517/use-strapi-for…
relyks Dec 7, 2023
9839b0e
chore(jobs-page): Resolve conflicts merging into master with new Team…
relyks Dec 7, 2023
fa4c5f3
chore: ajax to JS
stevekaplan123 Dec 13, 2023
2929c04
chore: add topics bucket to contextus site settings
stevekaplan123 Dec 13, 2023
b5495c3
Merge branch 'master' into helperbugs
stevekaplan123 Dec 13, 2023
ee20d85
Merge branch 'master' into feature/sc-21570/staff-who-edit-topic-page…
stevekaplan123 Dec 13, 2023
6c1a224
Updates Ways To Give pages for both languages to point to the most re…
relyks Dec 14, 2023
c716d15
Change "non-profit" to "nonprofit" in all instances
relyks Dec 14, 2023
2a46fff
Merge pull request #1734 from Sefaria/chore/sc-22401/not-able-to-add-…
stevekaplan123 Dec 14, 2023
522e67f
Merge pull request #1688 from Sefaria/feature/sc-21364/use-strapi-for…
relyks Dec 14, 2023
198df32
Merge branch 'master' into chore/sc-22912/replace-non-profit-strings-…
relyks Dec 14, 2023
1e9cb5b
Fix merge issue and change last remaining "non-profit" string
relyks Dec 14, 2023
61c44bb
Merge branch 'master' into helperbugs
stevekaplan123 Dec 17, 2023
8582756
Merge remote-tracking branch 'origin/master' into api-v3
edamboritz Dec 17, 2023
88f0c7d
chore(helm): Add Varnish cfg for v3 text api endpoint
edamboritz Dec 17, 2023
4ba2ba1
Merge remote-tracking branch 'origin/api-v3' into translations
edamboritz Dec 17, 2023
3a57303
Merge pull request #1744 from Sefaria/chore/sc-22872/update-static-pa…
relyks Dec 17, 2023
5cb1888
chore(otel): Disable otel (temporarily?)
edamboritz Dec 18, 2023
b85856e
test: Fix broken test on Baal Haturim
edamboritz Dec 19, 2023
823f2bc
Merge pull request #1747 from Sefaria/fix-baal-haturim-pytest
edamboritz Dec 19, 2023
759b73d
Merge pull request #1746 from Sefaria/disable-otel
edamboritz Dec 19, 2023
d7c83b8
fix(translations): add 1 to maxHeight for cases where for some reason…
YishaiGlasner Dec 19, 2023
2d0c4f6
Merge remote-tracking branch 'origin/master' into api-v3
YishaiGlasner Dec 19, 2023
b6c1da3
chore: it seems like partial merging has occurred
YishaiGlasner Dec 19, 2023
c8fa82a
Merge pull request #1743 from Sefaria/helperbugs
stevekaplan123 Dec 19, 2023
a0a7a0b
Merge pull request #1735 from Sefaria/feature/sc-21570/staff-who-edit…
stevekaplan123 Dec 19, 2023
37eef42
fix(copyFromReader): first approach for fixing - remove spans from te…
yonadavGit Dec 19, 2023
772d863
Merge pull request #1745 from Sefaria/chore/sc-22912/replace-non-prof…
relyks Dec 19, 2023
08a2e47
Merge pull request #1543 from Sefaria/api-v3
nsantacruz Dec 20, 2023
b34f86d
helm: remove superfluous double spaces!
nsantacruz Dec 20, 2023
b128a31
Merge pull request #1749 from Sefaria/small-helm-change
nsantacruz Dec 20, 2023
9bf885e
refactor(translation): move functions to the root of sefaria.js
YishaiGlasner Dec 20, 2023
873aeef
refactor(translation): rename versionTools to VersionBlockUtils
YishaiGlasner Dec 20, 2023
9f9da15
refactor(translation): use openStrings in OpenConnectionTabButton rat…
YishaiGlasner Dec 20, 2023
59733e0
fix(copyFromReader): second and cleaner approach - remove all spans t…
yonadavGit Dec 20, 2023
92bc445
refactor(translation): new manes for components
YishaiGlasner Dec 20, 2023
79140ad
refactor(translation): move all VersionBlock related components to a …
YishaiGlasner Dec 20, 2023
6ec8c91
Merge branch 'master' into translations
YishaiGlasner Dec 20, 2023
8be051b
fix(copyFromReader): clean code and remove debug prints
yonadavGit Dec 20, 2023
9b8f32c
Merge pull request #1751 from Sefaria/block-of-verses-not-copying-pro…
nsantacruz Dec 21, 2023
e06cc4c
Merge pull request #1750 from Sefaria/translations
nsantacruz Dec 21, 2023
c585499
feat(AboutNavBar): add hebrew getting started video button
yonadavGit Dec 21, 2023
96b2f03
feat(AboutNavBar): rotate vector img
yonadavGit Dec 21, 2023
abdd9f4
feat(AboutNavBar): add video length to button text
yonadavGit Dec 21, 2023
fe4bb0b
doc(api-v3): doc strings for Version attributes.
YishaiGlasner Dec 24, 2023
4e482c0
fix(api-v3): change 400 to 404 when ref is invalid or empty.
YishaiGlasner Dec 24, 2023
201d8af
refactor(api-v3): change TextManger to TextRequestAdapter.
YishaiGlasner Dec 24, 2023
2943990
doc(api-v3): doc string for TextRequestAdapter.
YishaiGlasner Dec 24, 2023
de5e59d
doc(api-v3): doc string for TextRange.
YishaiGlasner Dec 24, 2023
01eb7d1
refactor(api-v3): change versions to be a private param with a public…
YishaiGlasner Dec 24, 2023
fc8ff4c
test(api-v3): fix tests to fit the 400-404 change.
YishaiGlasner Dec 24, 2023
5f3fa24
refactor(api-v3): change isBaseText on client side to isSource (next …
YishaiGlasner Dec 24, 2023
d655283
fix(SearchFilters): changed 'path' regex to ignore books whose title …
yonadavGit Dec 25, 2023
d624079
fix(translations): hide pseudo-element marker (for safari doesn't sup…
YishaiGlasner Dec 26, 2023
ef0644a
fix(translations): pointer cursor for all summary element.
YishaiGlasner Dec 26, 2023
0f6a3b3
fix(Topic Editor): all topics can have alt titles
stevekaplan123 Dec 26, 2023
4364748
fix(Topics): display without links in the TOC but with links on topic…
stevekaplan123 Dec 26, 2023
1316f7e
chore(AboutNavSideBar): update link to video
yonadavGit Dec 26, 2023
5c62082
fix(Topics): topics shown in sidebar with markdown did not display ma…
stevekaplan123 Dec 28, 2023
63f665f
chore(AboutNavSideBar): make 'play button' vector face right
yonadavGit Jan 2, 2024
cd53180
chore(urls): Add a new redirect for tracking donations from @EliezerI…
relyks Jan 3, 2024
91ca4d4
chore(urls): Add generic method of redirecting to donation campaign p…
relyks Jan 3, 2024
5def4e3
chore(urls): Provide a default in case no ID was given
relyks Jan 3, 2024
8394e0f
Merge pull request #1755 from Sefaria/deprecate-isBaseText
YishaiGlasner Jan 7, 2024
456566d
Merge pull request #1762 from Sefaria/feature/sc-23163/topics-in-the-…
stevekaplan123 Jan 7, 2024
976dea5
Merge pull request #1759 from Sefaria/feature/sc-23034/organize-kabba…
stevekaplan123 Jan 7, 2024
3f13524
Merge pull request #1758 from Sefaria/topic-alt-titles
stevekaplan123 Jan 7, 2024
2ccf84d
test: change ref tests that used mekhilta (after refoactoring of mekh…
YishaiGlasner Jan 8, 2024
bedd2cf
Merge pull request #1767 from Sefaria/fix-mekhilta-tests
YishaiGlasner Jan 8, 2024
b6f1fd5
Merge branch 'master' into api-final
YishaiGlasner Jan 8, 2024
f5a70c0
Merge branch 'api-final' of https://github.com/Sefaria/Sefaria-Projec…
YishaiGlasner Jan 8, 2024
13ed03b
Merge branch 'master' into translations-fix
YishaiGlasner Jan 8, 2024
ebf1983
Merge pull request #1757 from Sefaria/zohar-bug-search-in-text
nsantacruz Jan 9, 2024
7686dd2
helm(feat): allocate more resources to mongo restore pod
BrendanGalloway Jan 9, 2024
4c80b8f
Merge pull request #1768 from Sefaria/increase-restore-cpu
edamboritz Jan 9, 2024
7844d89
ci: update monorepo release rules
BrendanGalloway Jan 9, 2024
5d87427
Merge pull request #1763 from Sefaria/add-new-redirect-for-munich-promo
edamboritz Jan 9, 2024
7f19395
Merge pull request #1771 from Sefaria/release-rules
edamboritz Jan 9, 2024
5217da9
fix: fully convert tref to URL form before looking it up in the legac…
nsantacruz Jan 10, 2024
85d208f
test(legacy ref): modify legacy ref tests to use a title with a space…
nsantacruz Jan 10, 2024
b8caab3
fix(legacy ref): make sure legacy tref is in URL form
nsantacruz Jan 10, 2024
a0bab3d
Merge pull request #1752 from Sefaria/hebrew-button-getting-started-v…
nsantacruz Jan 10, 2024
96be1df
refactor(legacy ref): move url form logic to function
nsantacruz Jan 10, 2024
df888d9
Merge pull request #1772 from Sefaria/fix-mekhilta-redirect
nsantacruz Jan 10, 2024
6d2f967
test(search): fix failing search filter test
nsantacruz Jan 10, 2024
e0e66b1
ci: restrict pytest concurrency to test possible resource constraints
BrendanGalloway Jan 10, 2024
6d3bfd7
fix(legacy): replace input title with normalized title in case input …
nsantacruz Jan 10, 2024
3fb1b5e
test(legacy ref): add alt title legacy ref test
nsantacruz Jan 10, 2024
6b1ab3f
Merge pull request #1773 from Sefaria/search-filter-test-fix
nsantacruz Jan 10, 2024
3c1608c
Merge pull request #1775 from Sefaria/fix-mekhilta-alt-title-legacy
nsantacruz Jan 10, 2024
f7494ac
Merge pull request #1774 from Sefaria/pytest-concurrency
edamboritz Jan 10, 2024
902f20e
Merge branch 'master' into api-final
YishaiGlasner Jan 10, 2024
9169d59
Merge branch 'master' into translations-fix
YishaiGlasner Jan 10, 2024
a8aeaee
fix(legacy ref): clean tref of underscores before replacing alt title…
nsantacruz Jan 10, 2024
56bc9f3
Merge pull request #1776 from Sefaria/fix-mekhilta-alt-title-legacy
nsantacruz Jan 10, 2024
696456e
Merge pull request #1756 from Sefaria/translations-fix
YishaiGlasner Jan 11, 2024
c978c70
Merge pull request #1754 from Sefaria/api-final
YishaiGlasner Jan 11, 2024
38704d3
fix(Search Result): markdown should be properly rendered
stevekaplan123 Jan 15, 2024
228bf44
Merge pull request #1778 from Sefaria/markdown-search-results
stevekaplan123 Jan 15, 2024
2181ef3
fix(search): remove newline that was auto-added
nsantacruz Jan 16, 2024
0f6c039
Merge pull request #1779 from Sefaria/fix-es-8-cronjob-newline
nsantacruz Jan 16, 2024
5e0a77a
Merge branch 'contextus' into new_master
stevekaplan123 Jan 16, 2024
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
62 changes: 62 additions & 0 deletions api/api_warnings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import django
django.setup()
from sefaria.model import *
from typing import List
from enum import Enum

class APIWarningCode(Enum):
APINoVersion = 101
APINoLanguageVersion = 102
APINoSourceText = 103
APINoTranslationText = 104

"""
classes for data warnings in API calls.
used when part of the data that was requested exists and returned, and part is missing.
"""

class APIDatawarning():
"""
general class
"""

def __init__(self):
pass


class TextsAPIResponseMessage(APIDatawarning):
"""
class for returning a message and an warning code
"""

def get_message(self) -> dict:
return {'warning_code': self.warning_code.value,
'message': self.message}


class APINoVersion(TextsAPIResponseMessage):

def __init__(self, oref: Ref, vtitle: str, lang: str):
self.warning_code = APIWarningCode.APINoVersion
self.message = f'We do not have version named {vtitle} with language {lang} for {oref}'


class APINoLanguageVersion(TextsAPIResponseMessage):

def __init__(self, oref: Ref, langs: List[str]):
self.warning_code = APIWarningCode.APINoLanguageVersion
self.message = f'We do not have the language you asked for {oref}. Available languages are {langs}'


class APINoSourceText(TextsAPIResponseMessage):

def __init__(self, oref: Ref):
self.warning_code = APIWarningCode.APINoSourceText
self.message = f'We do not have the source text for {oref}'


class APINoTranslationText(TextsAPIResponseMessage):

def __init__(self, oref: Ref):
self.warning_code = APIWarningCode.APINoTranslationText
self.message = f'We do not have a translation for {oref}'
218 changes: 218 additions & 0 deletions api/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
from django.test.client import Client
import django
django.setup()
from reader.tests import SefariaTestCase
import json
from api.api_warnings import APIWarningCode


c = Client()


class APITextsTests(SefariaTestCase):

def test_api_get_text_default(self):
response = c.get('/api/v3/texts/Genesis.1')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) == 1)
self.assertTrue(data["versions"][0]['actualLanguage'] == 'he')
self.assertEqual(data["book"], "Genesis")
self.assertEqual(data["categories"], ["Tanakh", "Torah"])
self.assertEqual(data["sections"], ['1'])
self.assertEqual(data["toSections"], ['1'])

def test_api_get_text_source_all(self):
response = c.get('/api/v3/texts/Shabbat.22a?version=source|all')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) > 1)
self.assertTrue(all(v['actualLanguage'] == 'he' for v in data["versions"]))
self.assertEqual(data["book"], "Shabbat")
self.assertEqual(data["categories"], ["Talmud", "Bavli", "Seder Moed"])
self.assertEqual(data["sections"], ["22a"])
self.assertEqual(data["toSections"], ["22a"])

def test_api_get_text_source(self):
response = c.get('/api/v3/texts/Shabbat.22a?version=source')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data["versions"][0]['versionTitle'], "William Davidson Edition - Vocalized Aramaic")

def test_api_get_text_translation_all(self):
response = c.get('/api/v3/texts/Shabbat.22a?version=translation|all')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) > 1)
self.assertTrue(any(v['actualLanguage'] == 'en' for v in data["versions"]))
self.assertEqual(data["book"], "Shabbat")
self.assertEqual(data["categories"], ["Talmud", "Bavli", "Seder Moed"])
self.assertEqual(data["sections"], ["22a"])
self.assertEqual(data["toSections"], ["22a"])

def test_api_get_text_translation(self):
response = c.get('/api/v3/texts/Shabbat.22a?version=translation')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data["versions"][0]['versionTitle'], "William Davidson Edition - English")

def test_api_get_text_lang_all(self):
response = c.get('/api/v3/texts/Rashi_on_Genesis.2.3?version=english|all')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) > 1)
self.assertTrue(all(v['actualLanguage'] == 'en' for v in data["versions"]))
self.assertEqual(data["book"], "Rashi on Genesis")
self.assertEqual(data["collectiveTitle"], "Rashi")
self.assertEqual(data["categories"], ["Tanakh", "Rishonim on Tanakh", "Rashi", "Torah"])
self.assertEqual(data["sections"], ['2', '3'])
self.assertEqual(data["toSections"], ['2', '3'])

def test_api_get_text_specific(self):
response = c.get('/api/v3/texts/Tosafot_on_Sukkah.2a.4.1?version=hebrew|Vilna_Edition')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data["versions"][0]['actualLanguage'], 'he')
self.assertEqual(data["versions"][0]['versionTitle'], 'Vilna Edition')
self.assertEqual(data["book"], "Tosafot on Sukkah")
self.assertEqual(data["collectiveTitle"], "Tosafot")
self.assertEqual(data["categories"], ["Talmud", "Bavli", "Rishonim on Talmud", "Tosafot", "Seder Moed"])
self.assertEqual(data["sections"], ["2a", '4', '1'])
self.assertEqual(data["toSections"], ["2a", '4', '1'])

def test_api_get_text_primary_all(self):
response = c.get('/api/v3/texts/Genesis.1?version=primary|all')
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) > 3)
self.assertTrue(all(v['actualLanguage'] == 'he' for v in data["versions"]))

def test_api_get_text_primary(self):
response = c.get('/api/v3/texts/Shabbat.22a?version=primary')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data["versions"][0]['versionTitle'], "William Davidson Edition - Vocalized Aramaic")

def test_api_get_text_two_params(self):
response = c.get('/api/v3/texts/Genesis.1?version=hebrew|Tanach with Nikkud&version=english|all')
data = json.loads(response.content)
self.assertTrue(len(data["versions"]) > 7)
self.assertEqual(data["versions"][0]['actualLanguage'], 'he')
self.assertTrue(all(v['actualLanguage'] == 'en' for v in data["versions"][1:]))

def test_api_get_text_range(self):
response = c.get('/api/v3/texts/Job.5.2-4')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(data["sections"], ['5', '2'])
self.assertEqual(data["toSections"], ['5', '4'])

def text_api_virtual_node(self):
response = c.get('/api/v3/texts/BDB, א')
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data['versions']), 1)
self.assertEqual(data['versions'][0]['text'], ['<big><span dir="rtl">א</span></big> <em>Āleph</em>, first letter; in post Biblical Hebrew = numeral 1 (and so in margin of printed MT); א̈= 1000; no evidence of this usage in OT times.'])

def test_api_get_text_bad_text(self):
response = c.get('/api/v3/texts/Life_of_Pi.13.13')
self.assertEqual(404, response.status_code)
data = json.loads(response.content)
self.assertEqual(data["error"], "Could not find title in reference: Life of Pi.13.13")

def test_api_get_text_out_of_bound(self):
response = c.get('/api/v3/texts/Genesis.999')
data = json.loads(response.content)
self.assertEqual(data["error"], "Genesis ends at Chapter 50.")

def test_api_get_text_too_many_hyphens(self):
response = c.get('/api/v3/texts/Genesis.9-4-5')
data = json.loads(response.content)
self.assertEqual(data["error"], "Couldn't understand ref 'Genesis.9-4-5' (too many -'s).")

def test_api_get_text_bad_sections(self):
response = c.get('/api/v3/texts/Job.6-X')
self.assertEqual(404, response.status_code)
data = json.loads(response.content)
self.assertEqual(data["error"], "Couldn't understand text sections: 'Job.6-X'.")

def test_api_get_text_empty_ref(self):
response = c.get("/api/v3/texts/Berakhot.1a")
self.assertEqual(404, response.status_code)
data = json.loads(response.content)
self.assertEqual(data["error"], "We have no text for Berakhot 1a.")

def test_api_get_text_no_source(self):
response = c.get("/api/v3/texts/The_Book_of_Maccabees_I.1?version=english|Brenton's_Septuagint&version=source")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data['warnings'][0]['source']['warning_code'], APIWarningCode.APINoSourceText.value)
self.assertEqual(data['warnings'][0]['source']['message'], 'We do not have the source text for The Book of Maccabees I 1')

def test_api_get_text_no_translation(self):
response = c.get("/api/v3/texts/Shuvi_Shuvi_HaShulamit?version=translation")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 0)
self.assertEqual(data['warnings'][0]['translation']['warning_code'], APIWarningCode.APINoTranslationText.value)
self.assertEqual(data['warnings'][0]['translation']['message'], 'We do not have a translation for Shuvi Shuvi HaShulamit')

def test_api_get_text_no_language(self):
response = c.get("/api/v3/texts/The_Book_of_Maccabees_I.1?version=english|Brenton's_Septuagint&version=sgrg|all")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data['warnings'][0]['sgrg|all']['warning_code'], APIWarningCode.APINoLanguageVersion.value)
self.assertEqual(data['warnings'][0]['sgrg|all']['message'],
"We do not have the language you asked for The Book of Maccabees I 1. Available languages are ['english', 'hebrew']")

def test_api_get_text_no_version(self):
response = c.get("/api/v3/texts/The_Book_of_Maccabees_I.1?version=english|Brenton's_Septuagint&version=hebrew|Kishkoosh")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data["versions"]), 1)
self.assertEqual(data['warnings'][0]['hebrew|Kishkoosh']['warning_code'], APIWarningCode.APINoVersion.value)
self.assertEqual(data['warnings'][0]['hebrew|Kishkoosh']['message'],
'We do not have version named Kishkoosh with language hebrew for The Book of Maccabees I 1')

def test_fill_in_missing_segments(self):
vtitle = "Maimonides' Mishneh Torah, edited by Philip Birnbaum, New York, 1967"
response = c.get(f"/api/v3/texts/Mishneh_Torah,_Sabbath_1?version=english|{vtitle}&fill_in_missing_segments=true")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue(len(data['versions'][0]['text']) > 2)
self.assertTrue(data['versions'][0].get('sources'))
self.assertEqual(data['versions'][0]['sources'][0], vtitle)
self.assertNotEqual(data['versions'][0]['sources'][2], vtitle)

def test_without_fill_in_missing_segments(self):
vtitle = "Maimonides' Mishneh Torah, edited by Philip Birnbaum, New York, 1967"
response = c.get(f"/api/v3/texts/Mishneh_Torah,_Sabbath_1?version=english|{vtitle}")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertEqual(len(data['versions'][0]['text']), 2)
self.assertFalse(data['versions'][0].get('sources'))

def test_wrap_all_entities(self):
vtitle = "The Contemporary Torah, Jewish Publication Society, 2006"
response = c.get(f"/api/v3/texts/Genesis%2010?version=english|{vtitle}&return_format=wrap_all_entities")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertTrue('<a class ="refLink"' in data['versions'][0]['text'][3])
self.assertTrue('<a href="/topics' in data['versions'][0]['text'][8])

def test_text_only(self):
response = c.get(f"/api/v3/texts/Shulchan_Arukh%2C_Orach_Chayim.1:1?return_format=text_only")
self.assertEqual(200, response.status_code)
data = json.loads(response.content)
self.assertFalse('<' in data['versions'][0]['text'])

def test_error_return_format(self):
response = c.get(f"/api/v3/texts/Shulchan_Arukh%2C_Orach_Chayim.1:1?return_format=not_valid")
self.assertEqual(400, response.status_code)
data = json.loads(response.content)
self.assertEqual(data['error'], "return_format should be one of those formats: ['default', 'wrap_all_entities', 'text_only'].")
58 changes: 58 additions & 0 deletions api/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
from sefaria.model import *
from sefaria.model.text_reuqest_adapter import TextRequestAdapter
from sefaria.client.util import jsonResponse
from django.views import View
from .api_warnings import *


class Text(View):

RETURN_FORMATS = ['default', 'wrap_all_entities', 'text_only']

def dispatch(self, request, *args, **kwargs):
try:
self.oref = Ref.instantiate_ref_with_legacy_parse_fallback(kwargs['tref'])
except Exception as e:
return jsonResponse({'error': getattr(e, 'message', str(e))}, status=404)
return super().dispatch(request, *args, **kwargs)

@staticmethod
def split_piped_params(params_string) -> List[str]:
params = params_string.split('|')
if len(params) < 2:
params.append('')
params[1] = params[1].replace('_', ' ')
return params

def _handle_warnings(self, data):
data['warnings'] = []
for lang, vtitle in data['missings']:
if lang == 'source':
warning = APINoSourceText(self.oref)
elif lang == 'translation':
warning = APINoTranslationText(self.oref)
elif vtitle and vtitle != 'all':
warning = APINoVersion(self.oref, vtitle, lang)
else:
warning = APINoLanguageVersion(self.oref, data['available_langs'])
representing_string = f'{lang}|{vtitle}' if vtitle else lang
data['warnings'].append({representing_string: warning.get_message()})
data.pop('missings')
data.pop('available_langs')
return data

def get(self, request, *args, **kwargs):
if self.oref.is_empty() and not self.oref.index_node.is_virtual:
return jsonResponse({'error': f'We have no text for {self.oref}.'}, status=404)
versions_params = request.GET.getlist('version', [])
if not versions_params:
versions_params = ['primary']
versions_params = [self.split_piped_params(param_str) for param_str in versions_params]
fill_in_missing_segments = request.GET.get('fill_in_missing_segments', False)
return_format = request.GET.get('return_format', 'default')
if return_format not in self.RETURN_FORMATS:
return jsonResponse({'error': f'return_format should be one of those formats: {self.RETURN_FORMATS}.'}, status=400)
text_manager = TextRequestAdapter(self.oref, versions_params, fill_in_missing_segments, return_format)
data = text_manager.get_versions_for_query()
data = self._handle_warnings(data)
return jsonResponse(data)
32 changes: 32 additions & 0 deletions build/ci/createJobFromRollout.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash

GITHUB_RUN_ID=$1
DEPLOY_ENV=$2

cat << EOF > job.yaml
apiVersion: batch/v1
kind: Job
metadata:
labels:
ci-run: "${GITHUB_RUN_ID}"
test-name: pytest
name: $DEPLOY_ENV-pytest-sandbox-$GITHUB_RUN_ID
spec:
backoffLimit: 2 # in waitForCIJob, we look for 2 fails before declaring failure. This could be made a variable.
template:
metadata:
labels:
ci-run: "${GITHUB_RUN_ID}"
test-name: pytest
spec:
EOF

kubectl get rollout $DEPLOY_ENV-web -o yaml | yq '.spec.template.spec' > spec.yaml
yq -i '.spec.template.spec += load("spec.yaml")' job.yaml
yq -i '.spec.template.spec.restartPolicy = "Never"' job.yaml
yq -i '.spec.template.spec.containers[0].args = ["-c", "pip3 install pytest-django; pytest -v -m \"not deep and not failing\" ./sefaria; echo $? > /dev/stdout; exit 0;"]' job.yaml
yq -i 'del(.spec.template.spec.containers[0].startupProbe)' job.yaml
yq -i 'del(.spec.template.spec.containers[0].livenessProbe)' job.yaml
yq -i 'del(.spec.template.spec.containers[0].readinessProbe)' job.yaml

kubectl apply -f job.yaml
Loading
Loading