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

[Feat]: Read baseurl from the projecturl #55

Open
sandeepa-kv-jois opened this issue Dec 2, 2022 · 3 comments
Open

[Feat]: Read baseurl from the projecturl #55

sandeepa-kv-jois opened this issue Dec 2, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@sandeepa-kv-jois
Copy link
Contributor

🔖 Feature description

Read baseurl from the projecturl annotation so that optional baseUrl for harness in app-config.yaml can be removed

@sandeepa-kv-jois sandeepa-kv-jois added the enhancement New feature or request label Dec 2, 2022
@OrkoHunter OrkoHunter added this to the CI/CD plugin V2 milestone Dec 5, 2022
@Yh010
Copy link

Yh010 commented Feb 28, 2023

I would like to work on this issue.
As far as I know, the way to resolve this would be :
1.remove the 'baseUrl' property in the app-config.yml under the harness section
2.find the projecturl annotation in the source code
3.use javax.annotation.processing.Processor or some java annotation processor to read the baseurl value from @ProjectUrl annotation at compile time.
4.Use the javax.tools.FileObject API to write the baseurl value to a file, such as a properties file.
5.and finally In the app-config.yaml file, replace the baseUrl property with a reference to the file containing the baseurl value.
Am I right? and if yes, could someone pls help me with locating the file which contains the projecturl annotation?

@Debanitrkl
Copy link
Member

Hi @Yh010, here projecturl is taken from the annotations in catalog and it's not part of the source code, so yeah you could reference it from the catalog and try out the steps 3 and 4.

Here's an example on how to create a catalog for Harness CI/CD plugin.

@OrkoHunter
Copy link
Collaborator

Usually the harness.io/project-url starts with the base url e.g. https://app.harness.io - so if the user has not defined the harness.baseUrl config in app-config.yaml, we should not mandate it, rather extract it from the project url annotation.

However, I think we should still keep the harness.baseUrl config as an optional field where users can declare their static harness url. However, with this change, it will no longer be mandatory and thus reduces the number of steps in installing the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants