-
Notifications
You must be signed in to change notification settings - Fork 1
Add results endpoint to download a static html file #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Hendrejvr
wants to merge
9
commits into
gematik:main
Choose a base branch
from
Hendrejvr:feature/html-doc-endpoint
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6cf6101
add results endpoint to download a static html file
Hendrejvr 4f1de06
check black format on PR
cybernop 1b82d36
also run formatting checks on push on main
cybernop 2741e29
update format
Hendrejvr 26e70a2
add output as HTML file functionality to CLI mode
Hendrejvr 2feddd9
update the formatting
Hendrejvr e6efca7
add inline css to html template
Hendrejvr 1e9d3f0
change MappingModel to MappingDetailsModel
Hendrejvr 99a16ae
remove commented out code
Hendrejvr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Check formatting | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
black: | ||
name: Black | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
|
||
- name: Install pipx | ||
run: sudo apt update && sudo apt install pipx && pipx ensurepath | ||
|
||
- name: Install Black | ||
run: pipx install --global black | ||
|
||
- name: Check formatting | ||
run: black --check --diff --include='.*\.py' ./service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,39 @@ | ||
import argparse | ||
from pathlib import Path | ||
|
||
from .serve import serve | ||
from .output import output | ||
|
||
parser = argparse.ArgumentParser(description="Compare profiles and generate mapping") | ||
|
||
subparsers = parser.add_subparsers(dest="cmd") | ||
subparsers = parser.add_subparsers(dest="cmd", required=True) | ||
|
||
parser_serve = subparsers.add_parser("serve", help="start the server") | ||
|
||
args = parser.parse_args() | ||
parser_output = subparsers.add_parser("output", help="generate output files") | ||
parser_output.add_argument( | ||
"--project-dir", | ||
type=Path, | ||
required=True, | ||
help="The project directory containing the profiles and config", | ||
) | ||
parser_output.add_argument( | ||
"--format", | ||
choices=["json", "html"], | ||
default="html", | ||
help="The output format (default: html)", | ||
) | ||
parser_output.add_argument( | ||
"--mapping_id", | ||
type=str, | ||
default=None, | ||
help="The ID of the mapping to generate output for (default: all mappings)", | ||
) | ||
|
||
args = parser.parse_args() | ||
if args.cmd == "serve": | ||
serve() | ||
elif args.cmd == "output": | ||
output(args.project_dir, args.format, args.mapping_id) | ||
else: | ||
parser.print_help() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is some strange mismatch here between types.
mapping
inmappingDict
is of typeMappingDetailsModel
andcreate_results_html
expectsMapping
. In the implementation ofcreate_results_html
the variable of typeMapping
is used likeMappingDetailsModel
, which causes the linter to go wild. I think what you really intended was the functioncreate_result_html
to receive a variable of typeMappingDetailsModel
.Please adjust the type in the function description.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I have adjusted it