diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 5fb986597387..d4b61c76789a 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,10 +1,22 @@ name: "Сообщить о проблеме" description: "Если что-то работает не так, как ожидалось." -labels: ["Bug"] +type: Bug body: - type: markdown attributes: - value: "## Пожалуйста, не стирайте строчки, которые были автоматически созданы." + value: "## В игре есть кнопка «Bug Report» в правом верхнем углу игры, при её нажатии часть информации ниже заполнится автоматически." + + - type: checkboxes + id: feature_scope + attributes: + label: "Категория бага" + description: "К какому типу контента относится проблема?" + options: + - label: "Код 👨‍💻" + - label: "Спрайты 🎨" + - label: "Карты 🗺️" + - label: "Перевод/Описание 🧠" + - type: textarea id: description @@ -13,10 +25,20 @@ body: attributes: label: "Описание" description: "Опишите одну проблему как можно подробнее" - value: | - #### Что должно было произойти - #### Что произошло на самом деле + - type: textarea + id: whatmusthappen + validations: + required: true + attributes: + label: "Что должно было произойти" + + - type: textarea + id: whathappenow + validations: + required: true + attributes: + label: "Что произошло на самом деле" - type: textarea id: reproduction diff --git a/.github/ISSUE_TEMPLATE/map_report.yml b/.github/ISSUE_TEMPLATE/map_report.yml deleted file mode 100644 index 85a14dcc0833..000000000000 --- a/.github/ISSUE_TEMPLATE/map_report.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: "Сообщить о проблеме на карте" -title: "[Название карты или локации] " -description: "Если что-то не так с картой" -labels: ["Bug", "Map Issue"] -body: - - type: dropdown - id: location - validations: - required: true - attributes: - label: "В какой локации это произошло?" - description: "Укажите станцию или локацию на которой вы нашли мапперскую ошибку. Если из перечисленных карт нет нужной, выберите 'другое' и укажите ниже о какой карте идёт речь" - options: - - BoxStation - - Gamma - - Delta - - Falcon - - Prometheus - - Stroecka - - Centcomm - - Asteroid - - Prometheus Asteroid - - Forts - - Другое - - - type: textarea - id: description - validations: - required: true - attributes: - label: "Описание" - description: "Опишите обнаруженную вами проблему на одной из локаций" - placeholder: | - На аванпост шахтёров невозможно попасть из-за стены в шлюзах доков diff --git a/.github/ISSUE_TEMPLATE/proposal.yml b/.github/ISSUE_TEMPLATE/proposal.yml index b13af01ec32e..dbd25900364a 100644 --- a/.github/ISSUE_TEMPLATE/proposal.yml +++ b/.github/ISSUE_TEMPLATE/proposal.yml @@ -1,8 +1,18 @@ name: "Оставить предложение" -title: "[Proposal] " description: "Любые идеи." -labels: ["Proposal"] +type: Feature body: + - type: checkboxes + id: feature_scope + attributes: + label: "Что потребует изменений?" + description: "Выберите тип изменений" + options: + - label: "Код 👨‍💻" + - label: "Спрайты 🎨" + - label: "Карты 🗺️" + - label: "Перевод/Описание 🧠" + - type: textarea id: description validations: diff --git a/.github/ISSUE_TEMPLATE/translation_report.yml b/.github/ISSUE_TEMPLATE/translation_report.yml deleted file mode 100644 index b6d909090ba5..000000000000 --- a/.github/ISSUE_TEMPLATE/translation_report.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: "Сообщить об ошибке в тексте или переводе" -description: "Некорректный текст или перевод на русский язык." -labels: ["Bug", "Translation/Localization"] -body: - - type: markdown - attributes: - value: "## Пожалуйста, не стирайте строчки, которые были автоматически созданы." - - - - type: textarea - id: location - validations: - required: true - attributes: - label: "Где вы нашли ошибку?" - description: "Укажите, где вы нашли ошибку в тексте: (Интерфейс консоли, описание предмета, некорректные комбат логи и т.п.)" - placeholder: | - Интерфейс консоли шаттла - Описание ручного сканера - Некорректный лог от выстрела из тазера - Оповещение импланта о смерти - - - type: textarea - id: description - validations: - required: true - attributes: - label: "Описание" - description: "Опишите обнаруженную ошибку в тексте как можно подробнее" - value: | - #### Как должно было звучать/переведено - AYS установил аккумулятор в электрический щит криогенных камер! - - #### Что произошло на самом деле - AYS установил аккумулятор в электрический щит криогенных камерах! - - - type: textarea - id: reproduction - attributes: - label: "Шаги воспроизведения" - description: "Если приемлемо, опишите шаги для воспроизведения проблемы в тексте" - placeholder: | - 1. Вытащить батарейку из электрического щита - 2. После вставить обратно батарейку - 3. Увидеть некорректный перевод данного лога - - - type: textarea - id: additional - attributes: - label: "Дополнительная информация:" - description: | - Вы можете добавьте скриншоты, чтобы помочь описать вашу проблему - **Подсказка**: Вы можете прикрепить изображения, щелкнув по области ниже для её выделения, - а затем перетащите в неё файлы diff --git a/.github/LABELER.yml b/.github/LABELER.yml new file mode 100644 index 000000000000..d5e5be2fb436 --- /dev/null +++ b/.github/LABELER.yml @@ -0,0 +1,96 @@ +# Changes to a .dmm or anything in the _map subfolder +'Map Edit': +- changed-files: + - any-glob-to-any-file: + - '**/*.dmm' + +# Any .dmi changes +'Sprites': +- changed-files: + - any-glob-to-any-file: + - '**/*.dmi' + +# Any sounds changes +'Sound': +- changed-files: + - any-glob-to-any-file: + - '**/*.aif' + - '**/*.aiff' + - '**/*.it' + - '**/*.mid' + - '**/*.midi' + - '**/*.mod' + - '**/*.mp3' + - '**/*.ogg' + - '**/*.oxm' + - '**/*.raw' + - '**/*.s3m' + - '**/*.wma' + - '**/*.wav' + - '**/*.xm' + +# Changes to the SQL subfolder +'Database': +- changed-files: + - any-glob-to-any-file: + - 'SQL/**' + +# Changes to the tgui subfolder +'UI': +- changed-files: + - any-glob-to-any-file: + - 'tgui/**' + - 'html/**' + - 'nano/**' + +# Changes to the config subfolder +'Config Update': +- changed-files: + - any-glob-to-any-file: + - 'config/**/*' + - 'config/example/**/*' + +# Changes to a .dm or anything in the code subfolder +'Code': +- changed-files: + - any-glob-to-any-file: + - '**/*.dm' + +# Any .json changes +'javascript': +- changed-files: + - any-glob-to-any-file: + - '**/*.json' + +# Changes to the .Github subfolder +'Maintainability Improvements': +- changed-files: + - any-glob-to-any-file: + - '.github/**' + - '.github/**/*' + - '.vscode/**/*' + - 'docs/**/*' + - 'scripts/**/*' + - 'test/**/*' + - '.codebeatignore' + - '.codebeatsettings' + - '.editorconfig' + - '.git*' + - 'biome.json' + - 'libmysql.dll' + - 'LICENSE' + - 'README.md' + - 'SpacemanDMM.toml' + +# Changes to the Tools folder +'Tools': +- changed-files: + - any-glob-to-any-file: + - 'tools/**/*' + +#Translation tools +'Translation/Localization': +- changed-files: + - any-glob-to-any-file: + - 'code/__DEFINES/_translation.dm' + - '.github/wiki/TRANSLATION.md' diff --git a/.github/workflows/auto_labels_issue.yml b/.github/workflows/auto_labels_issue.yml new file mode 100644 index 000000000000..c29990de1ad5 --- /dev/null +++ b/.github/workflows/auto_labels_issue.yml @@ -0,0 +1,127 @@ +name: Auto Label Issues + +on: + issues: + types: [opened] + +permissions: + issues: write + +jobs: + process-labels: + runs-on: ubuntu-latest + if: github.event.issue.state == 'open' + + steps: + - name: Parse and add labels based on checkboxes + id: process_issue + uses: actions/github-script@v7 + with: + script: | + const body = context.payload.issue.body; + console.log('Issue body:', body); + + const labelsToAdd = []; + let foundCheckboxesSection = false; + let sectionToRemove = ''; + + const scopeMap = { + 'Код 👨‍💻': 'Code', + 'Спрайты 🎨': 'Sprites', + 'Карты 🗺️': 'Map Issue', + 'Перевод/Описание 🧠': 'Translation/Localization' + }; + + if (body) { + if (body.includes('Что потребует изменений?')) { + foundCheckboxesSection = true; + sectionToRemove = 'Что потребует изменений?'; + console.log('Found "Что потребует изменений?" section'); + } else if (body.includes('Категория бага')) { + foundCheckboxesSection = true; + sectionToRemove = 'Категория бага'; + console.log('Found "Категория бага" section'); + } + + if (body.includes('[x]')) { + console.log('Found checked checkboxes in body'); + for (const [checkboxLabel, labelName] of Object.entries(scopeMap)) { + const checkboxRegex = new RegExp('\\[x\\]\\s*' + checkboxLabel.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')); + if (checkboxRegex.test(body)) { + labelsToAdd.push(labelName); + console.log('Found selected:', checkboxLabel, '->', labelName); + } + } + } + } + + const uniqueLabels = [...new Set(labelsToAdd)]; + console.log('Labels to add:', uniqueLabels); + + if (uniqueLabels.length > 0) { + try { + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + labels: uniqueLabels + }); + console.log('Labels added successfully'); + } catch (error) { + console.log('Error adding labels:', error); + } + } + + core.setOutput('foundCheckboxesSection', foundCheckboxesSection); + core.setOutput('sectionToRemove', sectionToRemove); + + return { + foundCheckboxesSection: foundCheckboxesSection, + sectionToRemove: sectionToRemove + }; + + - name: Clean up issue body + if: steps.process_issue.outputs.foundCheckboxesSection == 'true' + uses: actions/github-script@v7 + env: + SECTION_TO_REMOVE: ${{ steps.process_issue.outputs.sectionToRemove }} + with: + script: | + const body = context.payload.issue.body; + const sectionToRemove = process.env.SECTION_TO_REMOVE; + + console.log('Section to remove:', sectionToRemove); + console.log('Original body:', body); + + if (!body || !sectionToRemove) { + console.log('No body or section to clean'); + return; + } + + let cleanedBody = body; + + const regex = new RegExp('###?\\s*' + sectionToRemove + '[\\s\\S]*?((?=###)|$)', 'i'); + cleanedBody = cleanedBody.replace(regex, ''); + cleanedBody = cleanedBody.replace(/-\s*\[[x\s]\]\s*.*\n/g, ''); + cleanedBody = cleanedBody.replace(/_No response_/g, '_Отсутствует_'); + cleanedBody = cleanedBody.replace(/\n{3,}/g, '\n\n'); + cleanedBody = cleanedBody.replace(/^###\s*$/gm, ''); + cleanedBody = cleanedBody.trim(); + + console.log('Cleaned body:', cleanedBody); + + if (body !== cleanedBody && cleanedBody.length > 0) { + try { + await github.rest.issues.update({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: cleanedBody + }); + console.log('Issue body cleaned successfully'); + } catch (error) { + console.log('Error cleaning issue body:', error); + } + } else { + console.log('No changes to body needed'); + } diff --git a/.github/workflows/merge_conflict.yml b/.github/workflows/merge_conflict.yml new file mode 100644 index 000000000000..36bdc40456b1 --- /dev/null +++ b/.github/workflows/merge_conflict.yml @@ -0,0 +1,31 @@ +name: "Pull Request Labeler" + +permissions: + contents: read + +on: + push: + branches: + - main + pull_request_target: + +jobs: + triage: + permissions: + contents: read # may be required due to overwrite/add ambiguity + pull-requests: write # required to apply labels to PRs + runs-on: ubuntu-latest + steps: + - name: Check for conflicting PRs + uses: eps1lon/actions-label-merge-conflict@releases/2.x + with: + dirtyLabel: "Merge Conflict" + repoToken: "${{ secrets.GITHUB_TOKEN }}" + commentOnDirty: "Pull Request содержит конфликты. Устраните их, чтобы мы смогли оценить и принять запрос." + - name: Apply labels based on changed files + if: github.event_name != 'push' + uses: actions/labeler@v5 + with: + repo-token: "${{ secrets.TOKEN || secrets.GITHUB_TOKEN }}" + sync-labels: true + configuration-path: .github/LABELER.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index e5530d1be89b..0bb96fc52356 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -31,6 +31,7 @@ jobs: Данное предложение пробыло без активности открытым более полугода. Если вы найдёте того, кто его реализует, и вам нужно открыть данный ишью, пожалуйста, обратитесь к кому-либо из мейнтейнеров. Вы можете призвать их в комментарии слапнув ``@TauCetiStation/maintainers``. + only-issue-types: 'Feature' exempt-issue-labels: 'Bug, Task' days-before-issue-stale: 200 days-before-issue-close: 1