Pre-filled variables do not work for external custom CI config file paths
<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by the "regression" or "bug" label:
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression
- https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug
and verify the issue you're about to submit isn't a duplicate.
--->
### Summary
<!-- Summarize the bug encountered concisely. -->
Pre-filled variables do not show up on the run pipeline form when the project's CI configuration resides on a separate project.
### Steps to reproduce
<!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. -->
1. Create project X
1. In project X create a .gitlab-ci.yml
1. In the above file, add pre-defined variables
1. Try to run manual pipeline on project X
1. Pre-filled variables are shown on UI
1. Create project Y
1. Use settings of project Y to point its CI config path to project X: `X@.gitlab-ci.yml`
1. Try to run a manual pipeline on project Y
1. Pre-filled variables are not shown on the UI
### Example Project
<!-- If possible, please create an example project here on GitLab.com that exhibits the problematic
behavior, and link to it here in the bug report. If you are using an older version of GitLab, this
will also determine whether the bug is fixed in a more recent version. -->
https://gitlab.com/gitlab-gold/hchouraria/custom-ci-config-path-proj
### What is the current *bug* behavior?
<!-- Describe what actually happens. -->
Pre-filled variables defined in custom CI config path outside of repository does not render in run pipeline form
### What is the expected *correct* behavior?
<!-- Describe what you should see instead. -->
Pre-filled variables defined in custom CI config path outside of repository render in run pipeline form
### Relevant logs and/or screenshots
<!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code
as it's tough to read otherwise. -->
Issue appears to be with the implementation of the `ci_config_for(sha)` method. It returns nil when the path is outside of repository.
```
# p is the project where pipelines need to run
irb(main):007:0> p.ci_config_path
=> ".gitlab-ci.yml@neo/gradle-proj"
irb(main):008:0> p.ci_config_for("master")
=> nil
irb(main):009:0> p.ci_config_for("main")
=> nil
irb(main):010:0> p.ci_config_for("blah")
=> nil
irb(main):011:0> p.ci_config_for("85a2533964185560237c98c80857c1bac7267542")
=> nil
```
### Output of checks
<!-- If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com -->
This bug happens on GitLab.com
### Possible fixes
<!-- If you can, link to the line of code that might be responsible for the problem. -->
Call chain where this fails to resolve:
- https://gitlab.com/gitlab-org/gitlab/blob/7a1b3d9f7491a97160e053b4a96c62cb59d09a10/app/services/ci/list_config_variables_service.rb#L25
- https://gitlab.com/gitlab-org/gitlab/blob/aeff2cf9f841076ee6a1e2bb3d45a1689e38205a/app/models/project.rb#L2586-2588
- https://gitlab.com/gitlab-org/gitlab/blob/f16420e7e65c95032690584a73b5540a2f1885bd/app/models/repository.rb#L1042-1044
issue