Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: darrenburns/posting
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.6.0
Choose a base ref
...
head repository: darrenburns/posting
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 23,536 additions and 1,907 deletions.
  1. BIN .coverage
  2. +27 −0 .github/workflows/coverage.yml
  3. +28 −0 .github/workflows/docs.yml
  4. +50 −0 .github/workflows/test.yml
  5. +11 −1 .gitignore
  6. +26 −0 CONTRIBUTING.md
  7. +15 −0 Makefile
  8. +37 −263 README.md
  9. +273 −0 docs/CHANGELOG.md
  10. +1 −0 docs/CNAME
  11. BIN docs/assets/collection-tree.png
  12. BIN docs/assets/contextual-help.png
  13. BIN docs/assets/curl-export.png
  14. BIN docs/assets/default-collection.png
  15. BIN docs/assets/environments.mp4
  16. BIN docs/assets/home-efficiency-video.mp4
  17. +1,356 −0 docs/assets/home-image-ad-15aug24.svg
  18. BIN docs/assets/jump-mode.png
  19. BIN docs/assets/request-method-dropdown.png
  20. BIN docs/assets/scripts-tab.png
  21. BIN docs/assets/search-requests.png
  22. BIN docs/assets/themes.png
  23. BIN docs/assets/url-autocomplete.gif
  24. BIN docs/assets/url-bar.png
  25. +35 −0 docs/faq.md
  26. +74 −0 docs/guide/collections.md
  27. +11 −0 docs/guide/command_palette.md
  28. +139 −0 docs/guide/configuration.md
  29. +83 −0 docs/guide/environments.md
  30. +88 −0 docs/guide/external_tools.md
  31. +13 −0 docs/guide/help_system.md
  32. +25 −0 docs/guide/importing.md
  33. +186 −0 docs/guide/index.md
  34. +82 −0 docs/guide/keymap.md
  35. +61 −0 docs/guide/navigation.md
  36. +67 −0 docs/guide/requests.md
  37. +150 −0 docs/guide/scripting.md
  38. +106 −0 docs/guide/themes.md
  39. BIN docs/home-image.afdesign
  40. +4 −0 docs/index.md
  41. +1,753 −0 docs/overrides/home.html
  42. +133 −0 docs/roadmap.md
  43. +185 −0 docs/stylesheets/extra.css
  44. +69 −0 mkdocs.yml
  45. +35 −16 pyproject.toml
  46. +0 −105 requirements-dev.lock
  47. +0 −84 requirements.lock
  48. +35 −0 src/posting/__init__.py
  49. +40 −12 src/posting/__main__.py
  50. +4 −0 src/posting/_start_time.py
  51. +763 −312 src/posting/app.py
  52. +12 −0 src/posting/auth.py
  53. +211 −54 src/posting/collection.py
  54. +109 −48 src/posting/commands.py
  55. +105 −23 src/posting/config.py
  56. +1 −0 src/posting/exit_codes.py
  57. +146 −0 src/posting/files.py
  58. +11 −0 src/posting/help_data.py
  59. +12 −17 src/posting/help_screen.py
  60. +22 −18 src/posting/highlighters.py
  61. +292 −0 src/posting/importing/curl.py
  62. +69 −15 src/posting/importing/open_api.py
  63. +9 −10 src/posting/jump_overlay.py
  64. +2 −1 src/posting/jumper.py
  65. +7 −0 src/posting/locations.py
  66. +3 −3 src/posting/messages.py
  67. +355 −162 src/posting/posting.scss
  68. +56 −35 src/posting/request_headers.py
  69. +214 −0 src/posting/scripts.py
  70. +531 −0 src/posting/themes.py
  71. +4 −2 src/posting/user_host.py
  72. +72 −104 src/posting/variables.py
  73. +252 −40 src/posting/widgets/collection/browser.py
  74. +172 −29 src/posting/widgets/collection/new_request_modal.py
  75. +84 −0 src/posting/widgets/confirmation.py
  76. +109 −7 src/posting/widgets/datatable.py
  77. +29 −0 src/posting/widgets/input.py
  78. +1 −32 src/posting/widgets/key_value.py
  79. +11 −4 src/posting/widgets/request/form_editor.py
  80. +29 −19 src/posting/widgets/request/header_editor.py
  81. +2 −7 src/posting/widgets/request/method_selection.py
  82. +13 −18 src/posting/widgets/request/query_editor.py
  83. +108 −5 src/posting/widgets/request/request_auth.py
  84. +47 −108 src/posting/widgets/request/request_body.py
  85. +33 −54 src/posting/widgets/request/request_editor.py
  86. +12 −29 src/posting/widgets/request/request_metadata.py
  87. +7 −14 src/posting/widgets/request/request_options.py
  88. +241 −0 src/posting/widgets/request/request_scripts.py
  89. +78 −100 src/posting/widgets/request/url_bar.py
  90. +42 −10 src/posting/widgets/response/response_area.py
  91. +3 −1 src/posting/widgets/response/response_body.py
  92. +96 −0 src/posting/widgets/response/script_output.py
  93. +33 −0 src/posting/widgets/rich_log.py
  94. +254 −119 src/posting/widgets/text_area.py
  95. +7 −1 src/posting/widgets/tree.py
  96. +20 −18 src/posting/widgets/variable_autocomplete.py
  97. +20 −3 src/posting/widgets/variable_input.py
  98. +56 −0 src/posting/xresources.py
  99. +23 −0 src/posting/yaml.py
  100. +178 −0 ...__snapshots__/test_snapshots/TestCommandPalette.test_can_run_command__hide_collection_browser.svg
  101. +190 −0 tests/__snapshots__/test_snapshots/TestCommandPalette.test_can_type_to_filter_options.svg
  102. +229 −0 tests/__snapshots__/test_snapshots/TestCommandPalette.test_loads_and_shows_discovery_options.svg
  103. +225 −0 tests/__snapshots__/test_snapshots/TestConfig.test_config.svg
  104. +182 −0 tests/__snapshots__/test_snapshots/TestCurlExport.test_curl_export.svg
  105. +184 −0 tests/__snapshots__/test_snapshots/TestCurlExport.test_curl_export_no_setup.svg
  106. +231 −0 ...ots__/test_snapshots/TestCustomThemeComplex.test_highlighting_applied_from_custom_theme__json.svg
  107. +218 −0 ...hots__/test_snapshots/TestCustomThemeComplex.test_highlighting_applied_from_custom_theme__url.svg
  108. +231 −0 tests/__snapshots__/test_snapshots/TestCustomThemeSimple.test_theme_sensible_defaults__json.svg
  109. +219 −0 tests/__snapshots__/test_snapshots/TestCustomThemeSimple.test_theme_sensible_defaults__url.svg
  110. +188 −0 ...shots__/test_snapshots/TestCustomThemeSimple.test_theme_set_on_startup_and_in_command_palette.svg
  111. +193 −0 tests/__snapshots__/test_snapshots/TestDisableRowInTable.test_disable_row_in_table.svg
  112. +335 −0 ...ots__/test_snapshots/TestFocusAutoSwitchingConfig.test_focus_on_request_open__open_body[body].svg
  113. +334 −0 ...__/test_snapshots/TestFocusAutoSwitchingConfig.test_focus_on_request_open__open_body[headers].svg
  114. +331 −0 ...s__/test_snapshots/TestFocusAutoSwitchingConfig.test_focus_on_request_open__open_body[method].svg
  115. +335 −0 ...ts__/test_snapshots/TestFocusAutoSwitchingConfig.test_focus_on_request_open__open_body[query].svg
  116. +333 −0 ...hots__/test_snapshots/TestFocusAutoSwitchingConfig.test_focus_on_request_open__open_body[url].svg
  117. +269 −0 tests/__snapshots__/test_snapshots/TestHelpScreen.test_help_screen_appears.svg
  118. +187 −0 tests/__snapshots__/test_snapshots/TestJumpMode.test_click_switch.svg
  119. +184 −0 tests/__snapshots__/test_snapshots/TestJumpMode.test_focus_switch.svg
  120. +188 −0 tests/__snapshots__/test_snapshots/TestJumpMode.test_loads.svg
  121. +268 −0 tests/__snapshots__/test_snapshots/TestLoadingRequest.test_request_loaded_into_view__auth.svg
  122. +231 −0 tests/__snapshots__/test_snapshots/TestLoadingRequest.test_request_loaded_into_view__body.svg
  123. +224 −0 tests/__snapshots__/test_snapshots/TestLoadingRequest.test_request_loaded_into_view__headers.svg
  124. +268 −0 tests/__snapshots__/test_snapshots/TestLoadingRequest.test_request_loaded_into_view__options.svg
  125. +230 −0 ...s/__snapshots__/test_snapshots/TestLoadingRequest.test_request_loaded_into_view__query_params.svg
  126. +183 −0 tests/__snapshots__/test_snapshots/TestMethodSelection.test_select_post_method.svg
  127. +207 −0 tests/__snapshots__/test_snapshots/TestNewRequest.test_cannot_create_request_invalid_filename.svg
  128. +185 −0 tests/__snapshots__/test_snapshots/TestNewRequest.test_cannot_create_request_with_duplicate_name.svg
  129. +233 −0 tests/__snapshots__/test_snapshots/TestNewRequest.test_cannot_create_request_without_name.svg
  130. +207 −0 tests/__snapshots__/test_snapshots/TestNewRequest.test_cannot_supply_invalid_path_in_collection.svg
  131. +189 −0 tests/__snapshots__/test_snapshots/TestNewRequest.test_dialog_loads_and_can_be_used.svg
  132. +181 −0 ...test_snapshots/TestNewRequest.test_new_request_added_to_tree_correctly_and_notification_shown.svg
  133. +191 −0 ...__snapshots__/test_snapshots/TestSave.test_no_request_selected__dialog_is_prefilled_correctly.svg
  134. +225 −0 tests/__snapshots__/test_snapshots/TestScripts.test_script_runs.svg
  135. +224 −0 tests/__snapshots__/test_snapshots/TestSendRequest.test_send_request.svg
  136. +189 −0 tests/__snapshots__/test_snapshots/TestUrlBar.test_dropdown_appears_on_typing.svg
  137. +187 −0 tests/__snapshots__/test_snapshots/TestUrlBar.test_dropdown_completion_selected_via_enter_key.svg
  138. +187 −0 tests/__snapshots__/test_snapshots/TestUrlBar.test_dropdown_completion_selected_via_tab_key.svg
  139. +188 −0 tests/__snapshots__/test_snapshots/TestUrlBar.test_dropdown_filters_on_typing.svg
  140. +176 −0 tests/__snapshots__/test_snapshots/TestUserInterfaceShortcuts.test_expand_request_section.svg
  141. +186 −0 tests/__snapshots__/test_snapshots/TestUserInterfaceShortcuts.test_expand_then_reset.svg
  142. +178 −0 tests/__snapshots__/test_snapshots/TestUserInterfaceShortcuts.test_hide_collection_browser.svg
  143. +184 −0 tests/__snapshots__/test_snapshots/TestVariables.test_resolved_variables_highlight_and_preview.svg
  144. +190 −0 tests/__snapshots__/test_snapshots/TestVariables.test_unresolved_variables_highlighted.svg
  145. +10 −0 tests/posting_snapshot_app.py
  146. +231 −0 tests/resources/snapshot_report_template.jinja2
  147. +9 −1 { → tests}/sample-collections/echo-post.posting.yaml
  148. +7 −0 { → tests}/sample-collections/echo.posting.yaml
  149. 0 { → tests}/sample-collections/get-random-user.posting.yaml
  150. 0 { → tests}/sample-collections/jsonplaceholder/posts/comments/edit.posting.yaml
  151. +8 −0 { → tests}/sample-collections/jsonplaceholder/posts/comments/get-comments-query.posting.yaml
  152. 0 { → tests}/sample-collections/jsonplaceholder/posts/comments/get-comments.posting.yaml
  153. 0 { → tests}/sample-collections/jsonplaceholder/posts/create.posting.yaml
  154. 0 { → tests}/sample-collections/jsonplaceholder/posts/delete.posting.yaml
  155. 0 { → tests}/sample-collections/jsonplaceholder/posts/get-all.posting.yaml
  156. +1 −1 { → tests}/sample-collections/jsonplaceholder/posts/get-one.posting.yaml
  157. 0 { → tests}/sample-collections/jsonplaceholder/todos/get-all.posting.yaml
  158. +1 −1 { → tests}/sample-collections/jsonplaceholder/todos/get-one.posting.yaml
  159. +3 −0 { → tests}/sample-collections/jsonplaceholder/users/create.posting.yaml
  160. 0 { → tests}/sample-collections/jsonplaceholder/users/delete.posting.yaml
  161. 0 { → tests}/sample-collections/jsonplaceholder/users/get-all.posting.yaml
  162. +1 −1 { → tests}/sample-collections/jsonplaceholder/users/get-one.posting.yaml
  163. 0 { → tests}/sample-collections/jsonplaceholder/users/update.posting.yaml
  164. +31 −0 tests/sample-collections/scripts/my_script.py
  165. +14 −0 tests/sample-configs/custom_theme.yaml
  166. +13 −0 tests/sample-configs/custom_theme2.yaml
  167. +12 −0 tests/sample-configs/general.yaml
  168. +16 −0 tests/sample-configs/modified_config.yaml
  169. +5 −0 tests/sample-envs/sample_base.env
  170. +3 −0 tests/sample-envs/sample_extra.env
  171. +40 −0 tests/sample-themes/another_test.yml
  172. +10 −0 tests/sample-themes/serene_ocean.yaml
  173. +229 −0 tests/test_curl_export.py
  174. +247 −0 tests/test_curl_import.py
  175. +58 −0 tests/test_files.py
  176. +67 −0 tests/test_open_api_import.py
  177. +653 −0 tests/test_snapshots.py
  178. +75 −0 tests/test_variables.py
  179. +1,927 −0 uv.lock
Binary file added .coverage
Binary file not shown.
27 changes: 27 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a follow up job that runs after the CI job has completed.
# It'll post a code coverage comment on pull requests.
name: Post Coverage Comment

on:
workflow_run:
workflows: ["Continuous Integration"]
types:
- completed

jobs:
test:
name: Post Coverage Comment
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
permissions:
pull-requests: write
contents: write
actions: read
steps:
# !!! DO NOT run actions/checkout here, for security reasons !!!
# For details, refer to https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
- name: Post comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
28 changes: 28 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: docs
on:
push:
branches:
- main
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Configure Git Credentials
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: 3.x
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
- uses: actions/cache@v4
with:
key: mkdocs-material-${{ env.cache_id }}
path: .cache
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: mkdocs gh-deploy --force
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Continuous Integration

on:
pull_request:
push:
branches:
- "main"

env:
PYTEST_ADDOPTS: "--color=yes"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install a specific version of uv
uses: astral-sh/setup-uv@v5
with:
version: "0.6.3"
enable-cache: true
- run: uv python install # Will read from .python-version
- name: Install Dependencies
run: uv sync --all-extras --dev
- name: Run Tests
run: |
uv run make test-ci
- name: Attach Code Coverage
uses: py-cov-action/python-coverage-comment-action@v3.25
with:
GITHUB_TOKEN: ${{ github.token }}

- name: Save Snapshot Report
if: always()
uses: actions/upload-artifact@v4
with:
name: snapshot-report-posting
path: snapshot_report.html

- name: Store Pull Request Comment
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -7,4 +7,14 @@ wheels/
*.egg-info

# venv
.venv
.venv

# editor
.vscode/
.idea/

snapshot_report.html
*.afdesign
*.afdesign*
*.afphoto
*.afphoto*
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing to Posting

Posting is open to contributions! 🚀

Contributions of any type, no matter the "size" and form, are welcome!
Bug reports, typo fixes, ideas, questions, and code are all valuable ways of contributing.
If you're new to open source and would like a bit of extra guidance, don't be afraid to ask - we all start somewhere 😌

## How do I contribute?

You can suggest ideas by creating a discussion, or report bugs by creating an issue.

If you wish to contribute code, and it's a change which is not an "objective improvement", please open a discussion first.
An "objective improvement" is a change which _indisputably_ improves Posting.
Some examples include adding test coverage, performance improvements, bug fixes, and fixing clear inconsistencies.

By opening a discussion, we can make sure:

- You're not working on something that someone else has already started.
- The feature is within Posting's scope.
- We can iron out the details before you go and commit a bunch of time to it!
- Maintainers can give you tips, and the discussion will be a place you can ask for help and guidance.

---

This file is still a work in progress...
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

.PHONY: test
test:
$(run) pytest --cov=posting tests/ -n 24 -m "not serial" $(ARGS)
$(run) pytest --cov-report term-missing --cov-append --cov=posting tests/ -m serial $(ARGS)

.PHONY: test-snapshot-update
test-snapshot-update:
$(run) pytest --cov=posting tests/ -n 24 -m "not serial" --snapshot-update $(ARGS)
$(run) pytest --cov-report term-missing --cov-append --cov=posting tests/ -m serial --snapshot-update $(ARGS)


.PHONY: test-ci
test-ci:
$(run) pytest --cov=posting tests/ --cov-report term-missing $(ARGS)
Loading