Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .docker-compose.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ DOMAIN=http://localhost:5000/
INTERNAL_DOMAIN=http://192.168.168.167:5000/
API_DOMAIN=http://localhost:8000/
ELASTIC_URI=192.168.168.167:9200
ELASTIC6_URI=192.168.168.167:9201
ELASTIC8_URI=http://192.168.168.167:9202
ELASTIC8_USERNAME=elastic
OSF_DB_HOST=192.168.168.167
Expand Down
32 changes: 0 additions & 32 deletions .github/actions/build-es6/action.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .github/actions/start-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ runs:
- uses: ./.github/actions/build-es
with:
ELASTICSEARCH_ARCHIVE: ${{ env.ELASTICSEARCH_ARCHIVE }}
- uses: ./.github/actions/build-es6
with:
ELASTICSEARCH6_ARCHIVE: ${{ env.ELASTICSEARCH6_ARCHIVE }}
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ permissions:
env:
WHEELHOUSE: ~/.cache/wheelhouse
ELASTICSEARCH_ARCHIVE: elasticsearch-2.4.5.tar.gz
ELASTICSEARCH6_ARCHIVE: elasticsearch-6.3.1.tar.gz
OSF_DB_PORT: 5432
OSF_DB_PASSWORD: postgres
GITHUB_ACTIONS: true
Expand Down Expand Up @@ -140,6 +139,8 @@ jobs:
- uses: ./.github/actions/start-build
- name: Run tests
run: poetry run python3 -m invoke test-ci-api3-and-osf --junit
env:
ELASTIC8_URI: http://localhost:9202
- name: Upload report
if: (success() || failure()) # run this step even if previous step failed
uses: ./.github/actions/gen-report
Expand Down
27 changes: 27 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

We follow the CalVer (https://calver.org/) versioning scheme: YY.MINOR.MICRO.

26.12.0 (2026-06-23)
====================

- ES2 Consolidation

26.11.0 (2026-06-10)
====================

- Stop using elasticsearch6
- Change all osfmetrics-consuming code to use es8 from data migration in 26.10.0


26.10.7 (2026-06-10)
====================

- Fix typo in pyproject.toml

26.10.6 (2026-06-10)
====================

- Disable Preprint DELETE from API

26.10.5 (2026-06-09)
====================

- Prevent users from using URLs/domains in their names

26.10.4 (2026-06-04)
====================

Expand Down
8 changes: 2 additions & 6 deletions README-docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,7 @@

#### Special Instructions for Apple Chipset (M1, M2, etc.) and other ARM64 architecture

* _NOTE: The default `elasticsearch`, `elasticsearch6`, and `sharejs` containers are incompatible with ARM64._

- To run `elasticsearch6` on ARM64 architecture:

- Copy `docker-compose-dist-arm64.override.yml` into your `docker-compose.override.yml` file
* _NOTE: The default `elasticsearch` and `sharejs` containers are incompatible with ARM64._

- Running containers with docker compose

Expand Down Expand Up @@ -194,7 +190,7 @@

- Start all containers
```bash
alias dcsa="docker compose up -d assets admin_assets mfr wb fakecas sharejs worker elasticsearch elasticsearch6 web api admin preprints gv"
alias dcsa="docker compose up -d assets admin_assets mfr wb fakecas sharejs worker elasticsearch elasticsearch8 web api admin preprints gv"
```

- Shut down all containers
Expand Down
17 changes: 2 additions & 15 deletions addons/base/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import waffle
from django.db import transaction
from django.contrib.contenttypes.models import ContentType
from elasticsearch6 import exceptions as es_exceptions
from elasticsearch8 import exceptions as es_exceptions
from rest_framework import status as http_status

from api.caching.tasks import update_storage_usage_with_size
Expand All @@ -34,7 +34,7 @@
from framework.flask import redirect
from framework.sentry import log_exception
from framework.transactions.handlers import no_auto_transaction
from osf.metrics.es8_metrics import OsfCountedUsageEvent
from osf.metrics.events import OsfCountedUsageEvent
from website import settings
from addons.base import signals as file_signals
from addons.base.utils import format_last_known_metadata, get_mfr_url
Expand All @@ -54,7 +54,6 @@
FileVersionUserMetadata,
FileVersion, NotificationTypeEnum
)
from osf.metrics import PreprintView, PreprintDownload
from osf.utils import permissions
from osf.external.gravy_valet import request_helpers
from website.profile.utils import get_profile_image_url
Expand Down Expand Up @@ -686,12 +685,6 @@ def osfstoragefile_viewed_update_metrics(self, auth, fileversion, file_node):
return
if waffle.switch_is_active(features.ELASTICSEARCH_METRICS) and isinstance(resource, Preprint):
try:
PreprintView.record_for_preprint(
preprint=resource,
user=auth.user,
version=fileversion.identifier,
path=file_node.path,
)
OsfCountedUsageEvent.record(
user_id=getattr(user, '_id', None),
item_osfid=resource._id,
Expand Down Expand Up @@ -725,12 +718,6 @@ def osfstoragefile_downloaded_update_metrics(self, auth, fileversion, file_node)
return
if waffle.switch_is_active(features.ELASTICSEARCH_METRICS) and isinstance(resource, Preprint):
try:
PreprintDownload.record_for_preprint(
preprint=resource,
user=auth.user,
version=fileversion.identifier,
path=file_node.path,
)
OsfCountedUsageEvent.record(
user_id=getattr(user, '_id', None),
item_osfid=resource._id,
Expand Down
1 change: 0 additions & 1 deletion admin/base/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
re_path(r'^draft_registrations/', include('admin.draft_registrations.urls', namespace='draft_registrations')),
re_path(r'^files/', include('admin.files.urls', namespace='files')),
re_path(r'^share_reindex/', include('admin.share_reindex.urls', namespace='share_reindex')),
re_path(r'^notifications/', include('admin.notifications.urls', namespace='notifications')),
]),
),
]
Expand Down
7 changes: 6 additions & 1 deletion admin/base/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Utility functions and classes
"""
from osf.models import Subject, NodeLicense, Brand
from osf.models import Subject, NodeLicense, Brand, CedarMetadataTemplate

from django.core.exceptions import ValidationError, PermissionDenied
from django.urls import reverse
Expand Down Expand Up @@ -116,6 +116,11 @@ def get_brand_choices():
brands = Brand.objects.all()
return [no_default] + [(brand.id, brand.name) for brand in brands]

def get_cedar_template_choices():
no_default = ('', '---------')
templates = CedarMetadataTemplate.objects.filter(active=True)
return [no_default] + [(t.id, t.schema_name) for t in templates]

def get_toplevel_subjects():
return Subject.objects.filter(parent__isnull=True, provider___id='osf').values_list('id', 'text')

Expand Down
6 changes: 4 additions & 2 deletions admin/cedar/forms.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from django.forms import ModelForm, CharField, JSONField
from django.forms import ModelForm, CharField, JSONField, BooleanField

from osf.models import CedarMetadataTemplate


class CedarMetadataTemplateForm(ModelForm):
schema_name = CharField(
disabled=True,
Expand All @@ -18,7 +19,8 @@ class CedarMetadataTemplateForm(ModelForm):
template = JSONField(
disabled=True
)
is_for_collections = BooleanField(label='For collections only:', required=False)

class Meta:
model = CedarMetadataTemplate
fields = ['schema_name', 'cedar_id', 'template_version', 'template', 'active']
fields = ['schema_name', 'cedar_id', 'template_version', 'template', 'is_for_collections', 'active', 'should_index_for_search']
4 changes: 3 additions & 1 deletion admin/collection_providers/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from framework.utils import sanitize_html
from osf.models import CollectionProvider
from admin.base.utils import get_nodelicense_choices, get_defaultlicense_choices, validate_slug
from admin.base.utils import get_nodelicense_choices, get_defaultlicense_choices, validate_slug, get_cedar_template_choices


class CollectionProviderForm(forms.ModelForm):
Expand Down Expand Up @@ -37,9 +37,11 @@ class Meta:
def __init__(self, *args, **kwargs):
nodelicense_choices = get_nodelicense_choices()
defaultlicense_choices = get_defaultlicense_choices()
cedar_template_choices = get_cedar_template_choices()
super().__init__(*args, **kwargs)
self.fields['licenses_acceptable'].choices = nodelicense_choices
self.fields['default_license'].choices = defaultlicense_choices
self.fields['required_metadata_template'].choices = cedar_template_choices

def clean_description(self, *args, **kwargs):
if not self.data.get('description'):
Expand Down
Loading