Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

[$200] Allow for tags in project setup #453

Closed
jmgasper opened this issue May 31, 2022 · 13 comments
Closed

[$200] Allow for tags in project setup #453

jmgasper opened this issue May 31, 2022 · 13 comments

Comments

@jmgasper
Copy link
Collaborator

When setting up a Topcoder-X project, we need to allow copilots to select the technology tags for challenges created for that project, for tracking purposes.

A Topcoder-X project will have "general" tags, like [React, Javascript, HTML], or [C#, SQL Server], etc...

Currently, we don't apply any technologies to challenges created by Topcoder-X, but this change will allow copilots to set the technologies used by that individual project, when creating challenges for that project. This is important for proper tracking on the Topcoder platform and for reporting internally.

UI Change

In the UI on the add / edit project screen, we want to have a dropdown / selection for Tags, exactly the same as we do now in work manager (screenshot below). You should be able to take the code right from Work Manager (https://github.com/topcoder-platform/work-manager) that uses the API call to https://api.topcoder-dev.com/v4/technologies to populate the list

Note that we need to differentiate between dev and prod, so don't just hard code in the API call - make sure it uses the correct environment path, either Topcoder.com or Topcoder-dev.com.

Screen_Shot_2022-05-31_at_2_14_10_pm

Screen Shot 2022-05-31 at 2 10 46 pm

DynamoDB change

In the DynamoDB, we need to have a new field added to store the selected technologies along with the project record. Please ensure that:

  1. We can support existing projects that haven't selected a technology. An empty list should be allowed and will be the default for all existing projects
  2. The change needed to the schema is properly built and can be easily applied to the existing schema, since we're going to apply this over current data in the database and can't lose any data or expect to reset the database.

Topcoder-x-processor change

The Topcoder-X processor will need to change to use the list of tags when building the challenge object and POSTing that to the challenge API. You can see how Work Manager sends the tags list and do the exact same thing in the Topcoder-X processor. Make sure the processor uses the list pulled from DynamoDB for the project.

@jmgasper
Copy link
Collaborator Author

Challenge https://www.topcoder.com/challenges/f23bd725-d7dc-4b69-902d-62fa57577138 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@52cs 52cs self-assigned this May 31, 2022
@jmgasper
Copy link
Collaborator Author

Challenge https://www.topcoder.com/challenges/f23bd725-d7dc-4b69-902d-62fa57577138 has been assigned to 52code.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 2, 2022

@52cs - How's this one coming? Will it be done soon?

@52cs
Copy link
Collaborator

52cs commented Jun 2, 2022

@jmgasper
Have a look at draft version.
Two questions:

  1. Do we care about the order of tags which displayed in the challenge page?
    If so, the challenge tags will be updated even if from tags ['a', 'b', 'c'] to ['c', 'b', 'a'].
    You can change this setting by https://github.com/topcoder-platform/topcoder-x-ui/blob/9d116739423efc56e898117bf902f57362e44139/src/front/src/app/upsertproject/upsertproject.html#L82

  2. PATCH /challenges/:challengeId requires the tags not be empty: tags: Joi.array().items(Joi.string().required()).min(1), // tag names
    So, I restrict the new created or updated project should have non-empty tags currently.
    We can also remove this restrict and throw error when try to update challenges with empty tags which may occur with the feature of Bug - Archived projects still using copilot handle #442 [$40] Error when creating new project in dev #448

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 2, 2022

  1. No, the order doesn't matter, thanks.
  2. I'm fine if we restrict it going forward - I'll make sure copilots know about this when it's deployed to prod, thanks.

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 2, 2022

@52cs - The UI PR failed when building in CI/CD:

> topcoderx@1.0.0 build /topcoder-x-ui
> gulp build

[05:17:34] Using gulpfile /topcoder-x-ui/gulpfile.js
[05:17:34] Starting 'lint'...
[05:17:34] Starting 'styles'...
[05:17:35] Starting 'partials'...
[05:17:35] Starting 'images'...
[05:17:35] Starting 'fonts'...
[05:17:35] Starting 'fontawesome'...
[05:17:35] Starting 'misc'...
[05:17:36] Finished 'misc' after 1.29 s
[05:17:39] gulp-inject 23 files into index.less.
[05:17:40] Finished 'styles' after 5.1 s
[05:17:40] Starting 'browserify'...
[05:17:40] Finished 'fontawesome' after 4.89 s
[05:17:40] Finished 'fonts' after 5.47 s
[05:17:42] Finished 'images' after 7.78 s
[05:17:49] 
/topcoder-x-ui/src/config.js
  89:14  error  Parsing error: Unexpected token .

/topcoder-x-ui/src/services/ProjectService.js
  167:60  error  'challengeUUIDs' is not defined  no-undef

/topcoder-x-ui/src/front/src/app/projects/project.service.js
  187:86  error  Parsing error: Unterminated string constant

✖ 3 problems (3 errors, 0 warnings)

[05:17:49] 'lint' errored after 15 s
[05:17:49] ESLintError in plugin "gulp-eslint"
Message:
    Failed with 3 errors
[05:18:03] Finished 'browserify' after 23 s
[05:18:03] Finished 'partials' after 28 s
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! topcoderx@1.0.0 build: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the topcoderx@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-06-02T05_18_03_529Z-debug.log
ERROR: Service 'topcoder-x-ui' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1

@52cs
Copy link
Collaborator

52cs commented Jun 2, 2022

  1. No, the order doesn't matter, thanks.
  2. I'm fine if we restrict it going forward - I'll make sure copilots know about this when it's deployed to prod, thanks.

@jmgasper

  1. removed order restriction
  2. the form of ui will inform copilots to fill tags
  3. lint has been fixed

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 2, 2022

@52cs: Latest build failure of the ui:

> topcoderx@1.0.0 build /topcoder-x-ui
> gulp build

[08:02:07] Using gulpfile /topcoder-x-ui/gulpfile.js
[08:02:07] Starting 'lint'...
[08:02:07] Starting 'styles'...
[08:02:07] Starting 'partials'...
[08:02:08] Starting 'images'...
[08:02:08] Starting 'fonts'...
[08:02:08] Starting 'fontawesome'...
[08:02:08] Starting 'misc'...
[08:02:09] Finished 'misc' after 1.4 s
[08:02:12] gulp-inject 23 files into index.less.
[08:02:12] Finished 'styles' after 5.1 s
[08:02:12] Starting 'browserify'...
[08:02:12] Finished 'fontawesome' after 4.89 s
[08:02:13] Finished 'fonts' after 5.45 s
[08:02:15] Finished 'images' after 7.86 s
[08:02:22] Finished 'lint' after 15 s
[08:02:36] Finished 'browserify' after 24 s
[08:02:36] Starting 'inject'...
[08:02:36] gulp-inject 2 files into index.html.

events.js:377
      throw er; // Unhandled 'error' event
      ^
[PluginError: Error in parsing: "app/upsertproject/upsertproject.controller.js", Line 55: Unexpected token =>] {
  showStack: false,
  showProperties: true,
  plugin: 'gulp-angular-filesort',
  __safety: { toString: [Function: bound ] }
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! topcoderx@1.0.0 build: `gulp build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the topcoderx@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-06-02T08_02_36_714Z-debug.log
ERROR: Service 'topcoder-x-ui' failed to build: The command '/bin/sh -c npm run build' returned a non-zero code: 1

Exited with code exit status 1
CircleCI received exit code 1

@52cs
Copy link
Collaborator

52cs commented Jun 2, 2022

@jmgasper
ui should work now this time :)

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 2, 2022

@52cs - Thanks, updates are deployed in dev. I'll be testing this today / tomorrow.

One problem I see immediately is that the edit page isn't fully loading in dev, for an existing project

  • x.topcoder-dev.com, login with jcori / appirio123
  • Search projects for 2022, select 2022 TCX Test
  • The edit page doesn't load properly - see screenshot below

Screen Shot 2022-06-03 at 9 24 51 am

@52cs
Copy link
Collaborator

52cs commented Jun 3, 2022

@52cs - Thanks, updates are deployed in dev. I'll be testing this today / tomorrow.

One problem I see immediately is that the edit page isn't fully loading in dev, for an existing project

  • x.topcoder-dev.com, login with jcori / appirio123
  • Search projects for 2022, select 2022 TCX Test
  • The edit page doesn't load properly - see screenshot below
Screen Shot 2022-06-03 at 9 24 51 am

@jmgasper
fix empty tags from legacy db
two fix for create and update challenge with tags

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 5, 2022

@52cs - Looks good, thanks!

@jmgasper
Copy link
Collaborator Author

jmgasper commented Jun 5, 2022

Payment task has been updated: https://www.topcoder.com/challenges/f23bd725-d7dc-4b69-902d-62fa57577138
Payments Complete
Winner: 52code
Challenge f23bd725-d7dc-4b69-902d-62fa57577138 has been paid and closed.

This is an automated message for ghostar via Topcoder X

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants