Skip to content

fix: Fix ingest pr - #9743

Open
moijes12 wants to merge 1 commit into
mozilla:masterfrom
moijes12:fix-ingest-pr
Open

fix: Fix ingest pr#9743
moijes12 wants to merge 1 commit into
mozilla:masterfrom
moijes12:fix-ingest-pr

Conversation

@moijes12

Copy link
Copy Markdown
Contributor

Change Introduced

Use the correct endswith method instead of ends_with for ingesting PRs.

Before Fix

root@7073a8b8b5bd:/app# time python manage.py ingest pr --pr-url https://github.com/mozilla-mobile/android-components/pull/4821
/app/treeherder/etl/management/commands/ingest.py:463: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
Traceback (most recent call last):
  File "/app/manage.py", line 16, in <module>
    execute_from_command_line(sys.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
    utility.execute()
    ~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/django/core/management/__init__.py", line 437, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 420, in run_from_argv
    self.execute(*args, **cmd_options)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/django/core/management/base.py", line 464, in execute
    output = self.handle(*args, **options)
  File "/app/treeherder/etl/management/commands/ingest.py", line 484, in handle
    ingest_pr(options["prUrl"], root_url)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/treeherder/etl/management/commands/ingest.py", line 51, in ingest_pr
    if not pr_url.ends_with("/"):
           ^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'ends_with'. Did you mean: 'endswith'?

After Fix

root@7073a8b8b5bd:/app# time python manage.py ingest pr --pr-url https://github.com/mozilla-mobile/android-components/pull/4821
/app/treeherder/etl/management/commands/ingest.py:463: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
{"logging.googleapis.com/diagnostic": {"instrumentation_source": [{"name": "python", "version": "3.16.0"}]},"severity": "INFO", "logging.googleapis.com/labels": {"python_logger": "google.cloud.logging_v2.handlers.structured_log"}, "logging.googleapis.com/trace": "", "logging.googleapis.com/spanId": "", "logging.googleapis.com/trace_sampled": false, "logging.googleapis.com/sourceLocation": {"line": 151, "file": "/usr/local/lib/python3.13/site-packages/google/cloud/logging_v2/handlers/structured_log.py", "function": "emit_instrumentation_info"}, "httpRequest": {} }
{"message": "Skipping unsupported repo: https://github.com/mozilla-mobile/android-components None","severity": "WARNING", "logging.googleapis.com/labels": {"python_logger": "treeherder.etl.push_loader"}, "logging.googleapis.com/trace": "", "logging.googleapis.com/spanId": "", "logging.googleapis.com/trace_sampled": false, "logging.googleapis.com/sourceLocation": {"line": 43, "file": "/app/treeherder/etl/push_loader.py", "function": "process"}, "httpRequest": {} }

real    0m7.632s
user    0m4.604s
sys     0m0.941s

@gmierz @Archaeopteryx

Use the correct `endswith` method instead of `ends_with` for
ingesting PRs.
@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

Deploy Preview for treeherder ready!

Name Link
🔨 Latest commit 5a1214e
🔍 Latest deploy log https://app.netlify.com/projects/treeherder/deploys/6a6c9a1d300e640008001d44
😎 Deploy Preview https://deploy-preview-9743--treeherder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant