From 189530e1fd2c9ada4eebfd738213a406689ccdca Mon Sep 17 00:00:00 2001 From: Myuddin khatri Date: Wed, 7 Aug 2024 20:14:38 +0530 Subject: [PATCH 1/3] ci: change backport config --- .backportrc.json | 11 ----------- .github/workflows/backport.yaml | 24 ------------------------ .github/workflows/backport.yml | 26 ++++++++++++++++++++++++++ 3 files changed, 26 insertions(+), 35 deletions(-) delete mode 100644 .backportrc.json delete mode 100644 .github/workflows/backport.yaml create mode 100644 .github/workflows/backport.yml diff --git a/.backportrc.json b/.backportrc.json deleted file mode 100644 index e48e270..0000000 --- a/.backportrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "repoOwner": "agritheory", - "repoName": "cloud_storage", - "targetBranchChoices": ["version-14", "version-15"], - "targetBranches": ["version-14", "version-15"], - "autoMerge": true, - "autoMergeMethod": "squash", - "branchLabelMapping": { - "^auto-backport-to-(.+)$": "$1" - } -} diff --git a/.github/workflows/backport.yaml b/.github/workflows/backport.yaml deleted file mode 100644 index 94d5d17..0000000 --- a/.github/workflows/backport.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: Automatic backport action - -on: - pull_request_target: - types: ["labeled", "closed"] - -jobs: - backport: - name: Backport PR - runs-on: ubuntu-latest - steps: - - name: Backport Action - uses: sorenlouv/backport-github-action@v9.3.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - auto_backport_label_prefix: backport-to- - - - name: Info log - if: ${{ success() }} - run: cat ~/.backport/backport.info.log - - - name: Debug log - if: ${{ failure() }} - run: cat ~/.backport/backport.debug.log \ No newline at end of file diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml new file mode 100644 index 0000000..971e8a6 --- /dev/null +++ b/.github/workflows/backport.yml @@ -0,0 +1,26 @@ +name: Backport +on: + pull_request_target: + types: + - closed + - labeled + +jobs: + backport: + name: Backport + runs-on: ubuntu-latest + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) + steps: + - uses: tibdex/backport@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 5b3bb8101401ff0fb8da687822f64f990a3520fe Mon Sep 17 00:00:00 2001 From: Myuddin khatri Date: Mon, 12 Aug 2024 12:20:26 +0530 Subject: [PATCH 2/3] pre-commit: added codespell --- .pre-commit-config.yaml | 11 +- cloud_storage/cloud_storage/custom/file.json | 606 ++++++++----------- pyproject.toml | 3 + 3 files changed, 277 insertions(+), 343 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d010b2c..0445f98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,16 +70,23 @@ repos: - id: flake8 additional_dependencies: ['flake8-bugbear'] + - repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell + additional_dependencies: + - tomli + - repo: https://github.com/agritheory/test_utils - rev: v0.11.0 + rev: v0.15.0 hooks: + - id: update_pre_commit_config - id: validate_copyright files: '\.(js|ts|py|md)$' args: ["--app", "cloud_storage"] - id: clean_customized_doctypes args: ["--app", "cloud_storage"] - id: validate_customizations - args: ["--set-module", "True"] - id: validate_python_dependencies - id: validate_javascript_dependencies diff --git a/cloud_storage/cloud_storage/custom/file.json b/cloud_storage/cloud_storage/custom/file.json index 70a7500..71a81b6 100644 --- a/cloud_storage/cloud_storage/custom/file.json +++ b/cloud_storage/cloud_storage/custom/file.json @@ -1,342 +1,266 @@ { - "custom_fields": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2023-02-03 12:03:51.204553", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "File", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "s3_key", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 23, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "uploaded_to_google_drive", - "is_system_generated": 0, - "is_virtual": 0, - "label": "S3 Key", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-04-28 00:05:56.057223", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-s3_key", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2023-02-15 14:00:22.073075", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "File", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "sharing_link", - "fieldtype": "Data", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 24, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "s3_key", - "is_system_generated": 0, - "is_virtual": 0, - "label": "Sharing Link", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-04-28 00:05:56.148197", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-sharing_link", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 1, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 1, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2023-03-20 12:48:48.264679", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "File", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "section_break_1lqhx", - "fieldtype": "Section Break", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 25, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "sharing_link", - "is_system_generated": 0, - "is_virtual": 0, - "label": null, - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-04-28 00:05:56.255829", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-section_break_1lqhx", - "no_copy": 0, - "non_negative": 0, - "options": null, - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 0, - "unique": 0, - "width": null - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "allow_in_quick_entry": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "collapsible_depends_on": null, - "columns": 0, - "creation": "2023-03-20 12:48:48.360631", - "default": null, - "depends_on": null, - "description": null, - "docstatus": 0, - "dt": "File", - "fetch_from": null, - "fetch_if_empty": 0, - "fieldname": "file_association", - "fieldtype": "Table", - "hidden": 0, - "hide_border": 0, - "hide_days": 0, - "hide_seconds": 0, - "idx": 26, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_global_search": 0, - "in_list_view": 0, - "in_preview": 0, - "in_standard_filter": 0, - "insert_after": "section_break_1lqhx", - "is_system_generated": 0, - "is_virtual": 0, - "label": "", - "length": 0, - "mandatory_depends_on": null, - "modified": "2023-04-28 00:05:56.364321", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-file_association", - "no_copy": 0, - "non_negative": 0, - "options": "File Association", - "owner": "Administrator", - "permlevel": 0, - "precision": "", - "print_hide": 0, - "print_hide_if_no_value": 0, - "print_width": null, - "read_only": 0, - "read_only_depends_on": null, - "report_hide": 0, - "reqd": 0, - "search_index": 0, - "translatable": 0, - "unique": 0, - "width": null - } - ], - "custom_perms": [], - "doctype": "File", - "links": [], - "property_setters": [ - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-04-28 00:05:56.507961", - "default_value": null, - "doc_type": "File", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "section_break_8", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-04-28 00:05:56.507961", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-section_break_8-label", - "owner": "Administrator", - "property": "label", - "property_type": "Data", - "row_name": null, - "value": "Storage Details" - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-04-28 00:05:56.499487", - "default_value": null, - "doc_type": "File", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "section_break_8", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-04-28 00:05:56.499487", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-section_break_8-permlevel", - "owner": "Administrator", - "property": "permlevel", - "property_type": "Int", - "row_name": null, - "value": "1" - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-04-28 00:05:56.491129", - "default_value": null, - "doc_type": "File", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "preview", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-04-28 00:05:56.491129", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-preview-collapsible", - "owner": "Administrator", - "property": "collapsible", - "property_type": "Check", - "row_name": null, - "value": "1" - }, - { - "_assign": null, - "_comments": null, - "_liked_by": null, - "_user_tags": null, - "creation": "2023-04-28 00:05:56.481095", - "default_value": null, - "doc_type": "File", - "docstatus": 0, - "doctype_or_field": "DocField", - "field_name": "preview", - "idx": 0, - "is_system_generated": 0, - "modified": "2023-04-28 00:05:56.481095", - "modified_by": "Administrator", - "module": "Cloud Storage", - "name": "File-preview-collapsible_depends_on", - "owner": "Administrator", - "property": "collapsible_depends_on", - "property_type": "Data", - "row_name": null, - "value": "eval:true" - } - ], - "sync_on_migrate": 1 -} + "custom_fields": [ + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "creation": "2023-02-03 12:03:51.204553", + "default": null, + "docstatus": 0, + "dt": "File", + "fetch_if_empty": 0, + "fieldname": "s3_key", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 23, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "uploaded_to_google_drive", + "is_system_generated": 0, + "is_virtual": 0, + "label": "S3 Key", + "length": 0, + "modified": "2024-08-12 12:17:11.524307", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-s3_key", + "no_copy": 0, + "non_negative": 0, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "creation": "2023-02-15 14:00:22.073075", + "default": null, + "docstatus": 0, + "dt": "File", + "fetch_if_empty": 0, + "fieldname": "sharing_link", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 24, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "s3_key", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Sharing Link", + "length": 0, + "modified": "2024-08-12 12:17:11.524344", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-sharing_link", + "no_copy": 0, + "non_negative": 0, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 1, + "unique": 0 + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "creation": "2023-03-20 12:48:48.264679", + "default": null, + "docstatus": 0, + "dt": "File", + "fetch_if_empty": 0, + "fieldname": "section_break_1lqhx", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 25, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "sharing_link", + "is_system_generated": 0, + "is_virtual": 0, + "length": 0, + "modified": "2024-08-12 12:17:11.524352", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-section_break_1lqhx", + "no_copy": 0, + "non_negative": 0, + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0 + }, + { + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "creation": "2023-03-20 12:48:48.360631", + "default": null, + "docstatus": 0, + "dt": "File", + "fetch_if_empty": 0, + "fieldname": "file_association", + "fieldtype": "Table", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 26, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "section_break_1lqhx", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "modified": "2024-08-12 12:17:11.524358", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-file_association", + "no_copy": 0, + "non_negative": 0, + "options": "File Association", + "owner": "Administrator", + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "translatable": 0, + "unique": 0 + } + ], + "custom_perms": [], + "doctype": "File", + "links": [], + "property_setters": [ + { + "creation": "2023-04-28 00:05:56.507961", + "doc_type": "File", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "section_break_8", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-12 12:17:11.524364", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-section_break_8-label", + "owner": "Administrator", + "property": "label", + "property_type": "Data", + "value": "Storage Details" + }, + { + "creation": "2023-04-28 00:05:56.499487", + "doc_type": "File", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "section_break_8", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-12 12:17:11.524368", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-section_break_8-permlevel", + "owner": "Administrator", + "property": "permlevel", + "property_type": "Int", + "value": "1" + }, + { + "creation": "2023-04-28 00:05:56.491129", + "doc_type": "File", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "preview", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-12 12:17:11.524372", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-preview-collapsible", + "owner": "Administrator", + "property": "collapsible", + "property_type": "Check", + "value": "1" + }, + { + "creation": "2023-04-28 00:05:56.481095", + "doc_type": "File", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "preview", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-12 12:17:11.524376", + "modified_by": "Administrator", + "module": "Cloud Storage", + "name": "File-preview-collapsible_depends_on", + "owner": "Administrator", + "property": "collapsible_depends_on", + "property_type": "Data", + "value": "eval:true" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5c82090..8ac3ca5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,6 +20,9 @@ pytest-cov = "^5.0.0" requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" +[tool.codespell] +skip = "CHANGELOG.md" + [tool.pytest.ini_options] addopts = "--cov=cloud_storage --cov-report term-missing" From 8826577a379c6f95f5b7834d1b99822f8f6cfab5 Mon Sep 17 00:00:00 2001 From: Myuddin khatri Date: Mon, 12 Aug 2024 19:24:05 +0530 Subject: [PATCH 3/3] fix: remove extras from semantic release --- pyproject.toml | 52 +------------------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8ac3ca5..8041b32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,57 +39,7 @@ ensure_newline_before_comments = true indent = "\t" [tool.semantic_release] -assets = [] -commit_message = "{version}\n\nAutomatically generated by python-semantic-release" -commit_parser = "angular" -logging_use_named_masks = false -major_on_zero = true -tag_format = "v{version}" -version_variables = [ - "cloud_storage/__init__.py:__version__", - "pyproject.toml:version" -] +version_toml = ["pyproject.toml:tool.poetry.version"] [tool.semantic_release.branches.version] match = "version-15" -prerelease = false - -[tool.semantic_release.changelog] -template_dir = "templates" -changelog_file = "CHANGELOG.md" -exclude_commit_patterns = [] - -[tool.semantic_release.changelog.environment] -block_start_string = "{%" -block_end_string = "%}" -variable_start_string = "{{" -variable_end_string = "}}" -comment_start_string = "{#" -comment_end_string = "#}" -trim_blocks = false -lstrip_blocks = false -newline_sequence = "\n" -keep_trailing_newline = false -extensions = [] -autoescape = true - -[tool.semantic_release.commit_author] -env = "GIT_COMMIT_AUTHOR" -default = "semantic-release " - -[tool.semantic_release.commit_parser_options] -allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"] -minor_tags = ["feat"] -patch_tags = ["fix", "perf"] - -[tool.semantic_release.remote] -name = "origin" -type = "github" -ignore_token_for_push = false - -[tool.semantic_release.remote.token] -env = "GH_TOKEN" - -[tool.semantic_release.publish] -dist_glob_patterns = ["dist/*"] -upload_to_vcs_release = true