Skip to content

Commit

Permalink
Merge branch 'master' into arbabkhalil/PSRE-1253
Browse files Browse the repository at this point in the history
  • Loading branch information
rgraber authored Jan 12, 2024
2 parents 04b9ccc + ad9af3d commit 9162f25
Show file tree
Hide file tree
Showing 47 changed files with 851 additions and 861 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
# Adding new check for github-actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "openedx/arbi-bom"
19 changes: 19 additions & 0 deletions .github/workflows/add-depr-ticket-to-depr-board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Run the workflow that adds new tickets that are either:
# - labelled "DEPR"
# - title starts with "[DEPR]"
# - body starts with "Proposal Date" (this is the first template field)
# to the org-wide DEPR project board

name: Add newly created DEPR issues to the DEPR project board

on:
issues:
types: [opened]

jobs:
routeissue:
uses: openedx/.github/.github/workflows/add-depr-ticket-to-depr-board.yml@master
secrets:
GITHUB_APP_ID: ${{ secrets.GRAPHQL_AUTH_APP_ID }}
GITHUB_APP_PRIVATE_KEY: ${{ secrets.GRAPHQL_AUTH_APP_PEM }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_ISSUE_BOT_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/add-remove-label-on-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This workflow runs when a comment is made on the ticket
# If the comment starts with "label: " it tries to apply
# the label indicated in rest of comment.
# If the comment starts with "remove label: ", it tries
# to remove the indicated label.
# Note: Labels are allowed to have spaces and this script does
# not parse spaces (as often a space is legitimate), so the command
# "label: really long lots of words label" will apply the
# label "really long lots of words label"

name: Allows for the adding and removing of labels via comment

on:
issue_comment:
types: [created]

jobs:
add_remove_labels:
uses: openedx/.github/.github/workflows/add-remove-label-on-comment.yml@master

7 changes: 4 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ jobs:
os: [ubuntu-20.04]
python-version: ['3.8']
toxenv: [django22, django30, django31, django32, quality, docs, pii_check, check_keywords]
toxenv: [quality, docs, pii_check, django32, django42, check_keywords]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -34,7 +35,7 @@ jobs:
run: tox

- name: Run Coverage
if: matrix.python-version == '3.8' && matrix.toxenv=='django22'
if: matrix.python-version == '3.8' && matrix.toxenv=='django42'
uses: codecov/codecov-action@v1
with:
flags: unittests
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
commitlint:
uses: edx/.github/.github/workflows/commitlint.yml@master
uses: openedx/.github/.github/workflows/commitlint.yml@master
4 changes: 2 additions & 2 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/self-assign-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This workflow runs when a comment is made on the ticket
# If the comment starts with "assign me" it assigns the author to the
# ticket (case insensitive)

name: Assign comment author to ticket if they say "assign me"
on:
issue_comment:
types: [created]

jobs:
self_assign_by_comment:
uses: openedx/.github/.github/workflows/self-assign-issue.yml@master
2 changes: 1 addition & 1 deletion .github/workflows/upgrade-python-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}
uses: edx/.github/.github/workflows/upgrade-python-requirements.yml@master
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required: the version of this file's schema.
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
fail_on_warning: true

# Set the version of python needed to build these docs.
build:
os: "ubuntu-22.04"
tools:
python: "3.8"

# Optionally install extra requirements required to build your docs
python:
install:
- requirements: requirements/docs.txt
9 changes: 5 additions & 4 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[main]
host = https://www.transifex.com

[edx-platform.edx-toggles]
[o:open-edx:p:edx-platform:r:edx-toggles]
file_filter = edx_toggles/conf/locale/<lang>/LC_MESSAGES/django.po
source_file = edx_toggles/conf/locale/en/LC_MESSAGES/django.po
source_lang = en
type = PO
type = PO

[edx-platform.edx-toggles-js]
[o:open-edx:p:edx-platform:r:edx-toggles-js]
file_filter = edx_toggles/conf/locale/<lang>/LC_MESSAGES/djangojs.po
source_file = edx_toggles/conf/locale/en/LC_MESSAGES/djangojs.po
source_lang = en
type = PO
type = PO

24 changes: 24 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,33 @@ Change Log
Unreleased
~~~~~~~~~~

[5.1.0] - 2023-08-02
--------------------

* Added support for Django 4.2
* Rename toggle_warnings to toggle_warning for consistency with setting_warning.
* Switch from ``edx-sphinx-theme`` to ``sphinx-book-theme`` since the former is
deprecated

[5.0.0] - 2022-04-22
--------------------

* BREAKING CHANGE: Removed LegacyWaffle* classes. Although this is a breaking change, all known uses have already been fixed.
* Handle the case where certain toggle names come in as ``None`` when generating summary reports.
* Add ADR for updating annotations for toggle life expectancy and use cases.

[4.3.0] - 2022-01-31
--------------------

Removed
~~~~~~~

* Removed Django22, 30, 31

Added
~~~~~~~
* Added Django40 support in CI

[4.2.0] - 2021-07-07
~~~~~~~~~~~~~~~~~~~~

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
# Make sure to compile files after any other files they include!
pip-compile --upgrade --allow-unsafe --rebuild -o requirements/pip.txt requirements/pip.in
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip install -qr requirements/pip.txt
pip install -qr requirements/pip-tools.txt
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/scripts.txt requirements/scripts.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
Expand Down Expand Up @@ -96,7 +98,7 @@ detect_changed_source_translations:
cd edx-toggles && i18n_tool changed

pull_translations: ## pull translations from Transifex
tx pull -af --mode reviewed
tx pull -t -a -f --mode reviewed

push_translations: ## push source translation files (.po) from Transifex
tx push -s
Expand Down
20 changes: 9 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ Library and utilities for implementing and reporting on feature toggles.
Documentation is on `Read the Docs`_. Code repository is on `GitHub`_.

.. _Read the Docs: https://edx.readthedocs.io/projects/edx-toggles/en/latest/readme.html
.. _GitHub: https://github.com/edx/edx-toggles
.. _GitHub: https://github.com/openedx/edx-toggles

See the `scripts README`_ for more information on the scripts for reporting on the status of
feature toggles.

.. _scripts README: https://github.com/edx/edx-toggles/blob/master/scripts/README.rst
.. _scripts README: https://github.com/openedx/edx-toggles/blob/master/scripts/README.rst

License
-------
Expand All @@ -29,21 +29,19 @@ How To Contribute

Contributions are very welcome.

Please read `How To Contribute <https://github.com/edx/edx-platform/blob/master/CONTRIBUTING.rst>`_ for details.
Please read `How To Contribute <https://github.com/openedx/.github/blob/master/CONTRIBUTING.md>`_ for details.

Even though they were written with ``edx-platform`` in mind, the guidelines
should be followed for Open edX code in general.

PR description template should be automatically applied if you are sending PR from github interface; otherwise you
can find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/edx/edx-toggles/blob/master/.github/PULL_REQUEST_TEMPLATE.md>`_
can find it it at `PULL_REQUEST_TEMPLATE.md <https://github.com/openedx/edx-toggles/blob/master/.github/PULL_REQUEST_TEMPLATE.md>`_

Issue report template should be automatically applied if you are sending it from github UI as well; otherwise you
can find it at `ISSUE_TEMPLATE.md <https://github.com/edx/edx-toggles/blob/master/.github/ISSUE_TEMPLATE.md>`_
can find it at `ISSUE_TEMPLATE.md <https://github.com/openedx/edx-toggles/blob/master/.github/ISSUE_TEMPLATE.md>`_

Reporting Security Issues
-------------------------

Please do not report security issues in public. Please email security@edx.org.
Please do not report security issues in public. Please email security@openedx.org.

Getting Help
------------
Expand All @@ -58,8 +56,8 @@ refer to this `list of resources`_ if you need any assistance.
:target: https://pypi.python.org/pypi/edx-toggles/
:alt: PyPI

.. |ci-badge| image:: https://github.com/edx/edx-toggles/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/edx/edx-toggles/actions?query=workflow%3A%22Python+CI%22
.. |ci-badge| image:: https://github.com/openedx/edx-toggles/workflows/Python%20CI/badge.svg?branch=master
:target: https://github.com/openedx/edx-toggles/actions?query=workflow%3A%22Python+CI%22
:alt: Github CI

.. |codecov-badge| image:: http://codecov.io/github/edx/edx-toggles/coverage.svg?branch=master
Expand All @@ -75,5 +73,5 @@ refer to this `list of resources`_ if you need any assistance.
:alt: Supported Python versions

.. |license-badge| image:: https://img.shields.io/github/license/edx/edx-toggles.svg
:target: https://github.com/edx/edx-toggles/blob/master/LICENSE.txt
:target: https://github.com/openedx/edx-toggles/blob/master/LICENSE.txt
:alt: License
47 changes: 38 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import os
import re
import sys
from datetime import datetime
from subprocess import check_call

import edx_theme
from django import setup as django_setup
from django.conf import settings

Expand Down Expand Up @@ -63,7 +63,6 @@ def get_version(*file_paths):
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'edx_theme',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
Expand Down Expand Up @@ -94,8 +93,8 @@ def get_version(*file_paths):

# General information about the project.
project = 'edx-toggles'
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
author = edx_theme.AUTHOR
copyright = f'{datetime.now().year}, Axim Collaborative, Inc' # pylint: disable=redefined-builtin
author = 'Axim Collaborative, Inc'
project_title = 'edx-toggles'
documentation_title = f"{project_title}"

Expand Down Expand Up @@ -166,16 +165,46 @@ def get_version(*file_paths):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'edx_theme'
html_theme = 'sphinx_book_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
html_theme_options = {
"repository_url": "https://github.com/openedx/edx-toggles",
"repository_branch": "master",
"path_to_docs": "docs/",
"home_page_in_toc": True,
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
# Please don't change unless you know what you're doing.
"extra_footer": """
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img
alt="Creative Commons License"
style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png"/>
</a>
<br>
These works by
<a
xmlns:cc="https://creativecommons.org/ns#"
href="https://openedx.org"
property="cc:attributionName"
rel="cc:attributionURL"
>Axim Collaborative, Inc</a>
are licensed under a
<a
rel="license"
href="https://creativecommons.org/licenses/by-sa/4.0/"
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
"""
}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [edx_theme.get_html_theme_path()]
# html_theme_path = []

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
Expand All @@ -189,13 +218,13 @@ def get_version(*file_paths):
# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#
# html_logo = None
html_logo = "https://logos.openedx.org/open-edx-logo-color.png"

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None
html_favicon = "https://logos.openedx.org/open-edx-favicon.ico"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
4 changes: 2 additions & 2 deletions docs/decisions/0002-application-toggle-state.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ For security purposes:

Note: Django Setting toggles could also have a default provided upon retrieval. That topic will be covered under a separate ADR.

.. _WaffleFlag: https://github.com/edx/edx-platform/blob/77e490f0578cbaa5a4c2e6110b848cceef30962b/openedx/core/djangoapps/waffle_utils/__init__.py#L373
.. _WaffleFlag: https://github.com/openedx/edx-platform/blob/77e490f0578cbaa5a4c2e6110b848cceef30962b/openedx/core/djangoapps/waffle_utils/__init__.py#L373

Consequences
------------
Expand All @@ -47,7 +47,7 @@ The implementation of this toggle state endpoint needs to live with the toggle c

The current implementation of toggle state gathering will be refactored/reworked into the new endpoint.

.. _waffle_utils: https://github.com/edx/edx-platform/tree/77e490f0578cbaa5a4c2e6110b848cceef30962b/openedx/core/djangoapps/waffle_utils
.. _waffle_utils: https://github.com/openedx/edx-platform/tree/77e490f0578cbaa5a4c2e6110b848cceef30962b/openedx/core/djangoapps/waffle_utils

Rejected Alternatives
---------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/decisions/0003-django-setting-toggles.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Implementation Steps:
* Cleaning up `common.py` where appropriate by removing unnecessary defaults should also be done.
* We can define these in a `toggles.py` file in the apps. We can consider moving (permanent) waffle definitions from `waffle.py` to `toggles.py`.

.. _implemented setting toggle classes: https://github.com/edx/edx-toggles/blob/53cf1f71be35ee886521d3d6badafee69198a551/edx_toggles/toggles/internal/setting_toggle.py
.. _toggle state endpoint: https://github.com/edx/edx-platform/blob/216b99264a50011cb313f5b391abeae61870acee/openedx/core/djangoapps/waffle_utils/views.py#L20
.. _implemented setting toggle classes: https://github.com/openedx/edx-toggles/blob/53cf1f71be35ee886521d3d6badafee69198a551/edx_toggles/toggles/internal/setting_toggle.py
.. _toggle state endpoint: https://github.com/openedx/edx-platform/blob/216b99264a50011cb313f5b391abeae61870acee/openedx/core/djangoapps/waffle_utils/views.py#L20

Rejected Alternatives
---------------------
Expand Down
Loading

0 comments on commit 9162f25

Please sign in to comment.