diff --git a/.gitea/workflows/update-sources.yml b/.gitea/workflows/update-sources.yml index c2bc410..d11b00c 100644 --- a/.gitea/workflows/update-sources.yml +++ b/.gitea/workflows/update-sources.yml @@ -48,7 +48,8 @@ jobs: REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} run: python -m collection update --report "$RUNNER_TEMP/report.md" - name: Rebuild the analysis and run tests - if: steps.check.outputs.changed == 'true' + # not when the combined runs failed validation: the issue below reports the new answers instead + if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build') run: | python -m collection rebuild npm test @@ -69,7 +70,7 @@ jobs: path: ${{ runner.temp }}/raw-archive key: raw-archive-${{ hashFiles('data/manifest.json') }} - name: Open a pull request with the new data (it merges itself once CI passes) - if: steps.check.outputs.changed == 'true' + if: steps.check.outputs.changed == 'true' && !contains(steps.check.outputs.failed, 'build') env: ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }} run: | @@ -83,7 +84,7 @@ jobs: git push origin "$branch" python -m collection forge open-pr --head "$branch" --title "New data from the community sources" --body-file "$RUNNER_TEMP/report.md" --automerge - name: Report a broken source or new answers - if: steps.check.outputs.failed != '' + if: always() && steps.check.outputs.failed != '' env: ATLAS_BOT_TOKEN: ${{ secrets.ATLAS_BOT_TOKEN }} run: | diff --git a/core/atlas/coding.py b/core/atlas/coding.py index 69f658c..394701f 100644 --- a/core/atlas/coding.py +++ b/core/atlas/coding.py @@ -150,6 +150,10 @@ def code_row(r, C): company = company_raw[: -len(suffix)] if left_squad else company_raw if not left_squad and company in ("1 Squadmate", "2 Squadmates") and not (date and date >= F["left_squadmates_asked_from"]): left_squad = None # the form did not offer "left them" yet: unknown, not "stayed together" + alias = F.get("first_sighting_alias") or {} + if first in alias: + flags.append(f"first sighting answered as {first!r}") + first = alias[first] pools = F["sighting_pool"] pool = list(pools.get(company, {}).get(direction, [])) + (list(pools["Alone"].get(direction, [])) if left_squad else []) if first and first != "Unsure" and pool and first not in pool: diff --git a/core/spec/form.yaml b/core/spec/form.yaml index 94c7411..dced423 100644 --- a/core/spec/form.yaml +++ b/core/spec/form.yaml @@ -153,5 +153,10 @@ sighting_pool: 1 Squadmate: { East: [Green, Orange, Red], West: [Red, Brown, Green], Center: [Red, Brown] } 2 Squadmates: { East: [Red, Orange], West: [Green, Brown, Red], Center: [Red, Brown] } +# First-sighting answers that are not a single colour: coded as this colour, and the row is flagged with the +# original answer (data_flags), so nothing is lost. +first_sighting_alias: + "2 Greens": Green + # How a bulk-pasted row's attempt answer is read attempt_words: { first: 1, second: 2, third: 3, fourth: 4, fifth: 5 } diff --git a/data/dictionary.yaml b/data/dictionary.yaml index afb00ed..146e128 100644 --- a/data/dictionary.yaml +++ b/data/dictionary.yaml @@ -81,7 +81,7 @@ columns: For spreadsheet runs, the sheet's own row label: "Form" for a form submission (it has a timestamp); bulk-pasted logs keep the label they were pasted with. Bulk logs record every run of the players who kept them, so they are the least selectively reported rows. Empty for other sources. - values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import] + values: [Form, Data Import, BulkUpload3, Manual Upload, Historical import, Unknown import, Unknown] bot_mode: type: text description: >-