Skip to content
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

[HMA] Fix Create Exchange API Selector #1603

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hasher-matcher-actioner/.devcontainer/startup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
export OMM_CONFIG=/workspace/reference_omm_configs/development_omm_config.py
MIGRATION_COMMAND=1 flask --app OpenMediaMatch.app db upgrade --directory /workspace/src/OpenMediaMatch/migrations
flask --app OpenMediaMatch.app run --debug
MIGRATION_COMMAND=1 flask --app src/OpenMediaMatch.app db upgrade --directory /workspace/src/OpenMediaMatch/migrations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juanmrad - can you double check that this is correct? This script should be running with a working directory

Copy link
Collaborator

@juanmrad juanmrad Jul 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it should be running on the working directory. Where you having issues when running the shell script outside of dev container? or where you running it inside?

@aryzle

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @juanmrad this was failing on the dev container startup

Running the postAttachCommand from devcontainer.json...

[4812 ms] Start: Run in container: /bin/sh -c /workspace/.devcontainer/startup.sh
Error: Could not import 'OpenMediaMatch.app'.

this is after opening vscode in the hasher-matcher-actioner dir and selecting "Reopen in Container"
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like I was able to repro on a whole new build 🤔. Not sure how this may have changed to cause the problem.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like Juan is convinced, lets land it. I'll re-test on windows just to make sure there's not any evil differences between different vscodes.

flask --app src/OpenMediaMatch.app run --debug
8 changes: 5 additions & 3 deletions hasher-matcher-actioner/src/OpenMediaMatch/blueprints/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ def exchanges():
"""
Exchange management page
"""
return render_template(
"bootstrap.html.j2", page="exchanges", collabs=_collab_info()
)
template_vars = {
"exchange_apis": _api_cls_info(),
"collabs": _collab_info(),
}
return render_template("bootstrap.html.j2", page="exchanges", **template_vars)


@bp.route("/match")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<label for="exchange_create_form_api" class="form-label">API</label>
<select class="form-select" name="api" id="exchange_create_form_api" required>
<option selected disabled value="">Select API</option>
{% for api in exchangeApiList %}
<option>{{api}}</option>
{% for name, c in exchange_apis.items() %}
<option>{{name}}</option>
{% endfor %}
</select>
</div>
Expand Down
Loading