firebase / firebase-tools

The Firebase Command Line Tools
MIT License
3.97k stars 915 forks source link

`firebase deploy` fails to delete task function with an underscore in its name #7365

Open jangop opened 6 days ago

jangop commented 6 days ago

[REQUIRED] Environment info

firebase-tools: 13.11.4

Platform: Ubuntu 23.10 / fish

[REQUIRED] Test case

from firebase_functions import tasks_fn

@tasks_fn.on_task_dispatched()
def dummy_function(request: tasks_fn.CallableRequest) -> str:
    return "Hello World"

[REQUIRED] Steps to reproduce

  1. Initialize functions.
  2. Save the above function in functions/main.py (the default).
  3. Execute firebase deploy --only functions. dummy_function will be deployed. (cf. https://github.com/firebase/firebase-tools/issues/6324)
  4. Rename dummy_function to dummy in functions/main.py.
  5. Execute firebase deploy --only functions. When queried for deletion of dummy_function, answer y (yes).

[REQUIRED] Expected behavior

The old function should be deleted.

[REQUIRED] Actual behavior

The old function is not deleted. Instead, an error is shown.

✔  functions: functions folder uploaded successfully

The following functions are found in your project but do not exist in your local source code:
    dummy_function(us-central1)

If you are renaming a function or changing its region, it is recommended that you create the new function first before deleting the old one to prevent event loss. For more info, visit https://firebase.google.com/docs/functions/manage-functions#modify

? Would you like to proceed with deletion? Selecting no will continue the rest of the deployments. (y/N) 
i  functions: deleting Python 3.12 (2nd Gen) function dummy_function(us-central1)...
HTTP Error: 400, Queue ID "dummy_function" can contain only letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). Queue ID must be between 1 and 100 characters.
aalej commented 2 days ago

Hey @jangop, thanks for reaching out and providing a detailed report! I was able to reproduce the behavior you mentioned. Just to note, one thing I noticed is that during the first deployment, an error is also being raised, however the functions still seem to be deployed.

I’ll raise this to our engineering team so they can take a look.