Skip to content

Commit

Permalink
Merge branch 'em/domain-metrics-model-changes' into em/write-domain-m…
Browse files Browse the repository at this point in the history
…etrics
  • Loading branch information
nospame authored Jan 2, 2025
2 parents 603a49d + 1f9cff1 commit 6c5d5b4
Show file tree
Hide file tree
Showing 75 changed files with 3,257 additions and 4,088 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@


/.github/ @orangejenny
/.github/workflows/ @dimagi/dependency-watchers

/corehq/blobs/ @millerdev
/corehq/ex-submodules/casexml/apps/phone/data_providers/case/livequery.py @millerdev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
DATADOG_APP_KEY: ${{ secrets.DATADOG_APP_KEY }}
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: install libxml
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check changed py files
id: changed-files
uses: tj-actions/changed-files@v41
uses: tj-actions/changed-files@v45
with:
files: |
**/*.py
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
if: ${{ steps.changed-files.outputs.all_changed_files }}
with:
python-version: 3.9
Expand All @@ -53,7 +53,7 @@ jobs:

steps:
- name: Check out Git repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install docs requirements
Expand All @@ -19,7 +19,7 @@ jobs:
run: bash ./scripts/test-make-docs.sh
- name: Upload test artifacts
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: make-docs-artifacts
path: artifacts
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
name: Update transifex translations
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: master
submodules: recursive
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a
Expand Down Expand Up @@ -47,8 +47,8 @@ jobs:
UPDATE_TRANSLATIONS_SKIP_GIT: 1
- name: Create Pull Request
# https://github.com/marketplace/actions/create-pull-request
# Pinned to the commit of https://github.com/peter-evans/create-pull-request/releases/tag/v5.0.2
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38
# Pinned to the commit of https://github.com/peter-evans/create-pull-request/releases/tag/v7.0.5
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
token: ${{ steps.generate-token.outputs.token }}
base: master
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29337,8 +29337,8 @@ define('vellum/form',[
updateInstanceQuery: function (query, instanceId, oldId) {
var regexp = INSTANCE_REGEXP;
if (oldId) {
regexp = new RegExp("(^|\W)instance\\((['\"])" +
RegExp.escape(oldId) + "\2\\)", "ig");
regexp = new RegExp("(^|\\W)instance\\((['\"])" +
RegExp.escape(oldId) + "\\2\\)", "ig");
}
return query.replace(regexp, "$1instance('" + instanceId + "')");
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
80cab1f727e90f4947d3c3d1bfc97910d7944349
19c244da08e3d552465acaefbc9274fb8bde21f5
44 changes: 29 additions & 15 deletions corehq/apps/builds/models.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
from datetime import datetime
from looseversion import LooseVersion
from zipfile import ZipFile

from couchdbkit.exceptions import BadValueError, ResourceNotFound

from dimagi.ext.couchdbkit import *
from dimagi.ext.couchdbkit import (
BooleanProperty,
DateTimeProperty,
Document,
DocumentSchema,
IntegerProperty,
SchemaListProperty,
SchemaProperty,
StringListProperty,
StringProperty,
)

from corehq.apps.app_manager.const import APP_V2
from corehq.apps.builds.fixtures import commcare_build_config
from corehq.apps.domain import SHARED_DOMAIN
from corehq.blobs import CODES as BLOB_CODES
from corehq.blobs.mixin import BlobMixin
from corehq.util.quickcache import quickcache
Expand Down Expand Up @@ -83,20 +91,26 @@ def get_build(cls, version, build_number=None, latest=False):
startkey = [version, build_number]

self = cls.view('builds/all',
startkey=startkey + [{}],
endkey=startkey,
descending=True,
limit=1,
include_docs=True,
reduce=False,
).one()
startkey=startkey + [{}],
endkey=startkey,
descending=True,
limit=1,
include_docs=True,
reduce=False,
).one()

if not self:
raise KeyError("Can't find build {label}. For instructions on how to add it, see https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/builds/README.md".format(label=BuildSpec(
version=version,
build_number=build_number,
latest=latest
)))
raise KeyError(
"Can't find build {label}. For instructions on how to add it, see "
"https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/builds/"
"README.rst#adding-commcare-builds-to-commcare-hq".format(
label=BuildSpec(
version=version,
build_number=build_number,
latest=latest
)
)
)
return self

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ hqDefine("cloudcare/js/formplayer/menus/controller", [
options.preview = UsersModels.getCurrentUser().displayOptions.singleAppMode;

var fetchingNextMenu = FormplayerFrontend.getChannel().request("app:select:menus", options);
var promise = $.Deferred();

/*
Determine the next screen to display. Could be
Expand All @@ -48,6 +49,7 @@ hqDefine("cloudcare/js/formplayer/menus/controller", [
*/
$.when(fetchingNextMenu).done(function (menuResponse) {
if (menuResponse.abort) {
promise.reject();
return;
}

Expand All @@ -64,6 +66,7 @@ hqDefine("cloudcare/js/formplayer/menus/controller", [
// If redirect was set, clear and go home.
if (menuResponse.clearSession) {
FormplayerFrontend.trigger("apps:currentApp");
promise.reject();
return;
}

Expand Down Expand Up @@ -94,6 +97,7 @@ hqDefine("cloudcare/js/formplayer/menus/controller", [
FormplayerFrontend.trigger('showError', "Response did not contain appId even though it was" +
"required. If this persists, please report an issue to CommCare HQ");
FormplayerFrontend.trigger("apps:list");
promise.reject();
return;
}
urlObject.appId = menuResponse.appId;
Expand All @@ -110,10 +114,13 @@ hqDefine("cloudcare/js/formplayer/menus/controller", [
menusUtils.handleLocationRequest(options);
}
menusUtils.startOrStopLocationWatching(menuResponse.shouldWatchLocation);
promise.resolve(menuResponse);
}).fail(function () {
// if it didn't go through, then it displayed an error message.
// the right thing to do is then to just stay in the same place.
promise.reject();
});
return promise;
};

var selectDetail = function (caseId, detailIndex, isPersistent, isMultiSelect) {
Expand Down
Loading

0 comments on commit 6c5d5b4

Please sign in to comment.