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: add support for providing alternate resource directory and config.yaml file #41

Closed

Conversation

xitij2000
Copy link
Contributor

@xitij2000 xitij2000 commented Aug 17, 2023

This change adds support for specifying an alternative resource directory, allowing resources to be overridden without needing to fork the repository.

With this change you can use an environment variable to specify a custom location for the config.yaml file and in that you can specify a directory to override resources from the app. This way you can have a completely custom build with a custom theme, logos, string etc without making any changes to the repo itself.

@xitij2000 xitij2000 force-pushed the kshitij/configurable-resource-dir branch from 7e8ac3c to 0c53f0e Compare August 17, 2023 14:50
@xitij2000 xitij2000 marked this pull request as ready for review August 21, 2023 08:20
Copy link
Member

@yusuf-musleh yusuf-musleh left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: I built the android app and confirmed the new resources were showing within the app
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation: Needs to include small comment in documentation.
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

sourceSets {
prod {
def envMap = config.environments.find { it.key == "PROD" }
if (envMap.value.RES_DIR) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can include a small comment in the README about using RES_DIR variable to include custom resources in the app?

@xitij2000 xitij2000 changed the title feat: add support for providing alternate resource directory feat: add support for providing alternate resource directory and config.yaml file Aug 21, 2023
Copy link
Member

@yusuf-musleh yusuf-musleh left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@@ -6,6 +15,9 @@ plugins {
id "com.google.firebase.crashlytics"
}

def config_file = System.getenv("OPENEDX_ANDROID_CFG_FILE") ?: "config.yaml"
Copy link
Member

Choose a reason for hiding this comment

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

I managed to rebuild the app while providing a different location for the config file using this ENV variable.


5. Select the build variant ``develop``, ``stage``, or ``prod``.

6. Click the **Run** button.

## Customising
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for updating the README.

@xitij2000 xitij2000 changed the base branch from main to develop August 31, 2023 09:37
@xitij2000 xitij2000 requested a review from a team as a code owner August 31, 2023 09:37
This change adds support for specifying an alternative resource directory, allowing resources to be overridden without needing to fork the repository.
This change makes it possible to specify an alternative location for the
config.yaml file using an environment variable. This allows the developers to
override all important data without messing up any files that can be committed
to the repository.
@xitij2000 xitij2000 force-pushed the kshitij/configurable-resource-dir branch from ffd3914 to 9f8c4f1 Compare August 31, 2023 09:37
@itsjeyd itsjeyd added the open-source-contribution PR author is not from Axim or 2U label Oct 31, 2023
@itsjeyd
Copy link

itsjeyd commented Oct 31, 2023

@xitij2000 @yusuf-musleh It looks like this PR wasn't added to the Contributions board nor marked as an open source contribution (presumably because when it was opened, the openedx-app-android repo hadn't been moved from https://github.com/raccoongang/ to https://github.com/raccoongang/). As a result it wasn't on @mphilbrick211 and I's radar, and we didn't triage it as part of OSPR management.

I've updated it now to show up on the board.

@volodymyr-chekyrta This PR is ready for engineering review. Could you please have a look?

@openedx-webhooks
Copy link

openedx-webhooks commented Oct 31, 2023

Thanks for the pull request, @xitij2000! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@itsjeyd itsjeyd added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Oct 31, 2023
@mphilbrick211
Copy link

Thanks, @itsjeyd! I've added this to my tracker.

@volodymyr-chekyrta
Copy link
Contributor

@xitij2000, appreciation for your valuable contribution!
We've implemented two similar mechanisms:
#99 - offering an alternative resource directory
#135 - incorporating custom config files

Looks like they are honoring the original request.
Can we close this PR?

@volodymyr-chekyrta volodymyr-chekyrta added the duplicate This issue or pull request already exists elsewhere label Jan 30, 2024
@xitij2000
Copy link
Contributor Author

@xitij2000, appreciation for your valuable contribution! We've implemented two similar mechanisms: #99 - offering an alternative resource directory #135 - incorporating custom config files

Looks like they are honoring the original request. Can we close this PR?

I think custom settings are lot better with the recent changes, however I was hoping to have a mechanism for theming that could also allow loading resources from a custom location without touching the app's code. I'm not sure if this allows that though, I haven't investigated deeply enough. In any case I'm closing this since it's been implemented already as you mentioned.

Thanks!

@xitij2000 xitij2000 closed this Jan 30, 2024
@openedx-webhooks
Copy link

@xitij2000 Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future.

farhan-arshad-dev pushed a commit to farhan-arshad-dev/openedx-app-android that referenced this pull request Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists elsewhere open-source-contribution PR author is not from Axim or 2U waiting for eng review PR is ready for review. Review and merge it, or suggest changes.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants